]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: work around warning in assegments_parse()
authorDenis Ovsienko <infrastation@yandex.ru>
Fri, 4 Dec 2009 14:32:54 +0000 (17:32 +0300)
committerDenis Ovsienko <infrastation@yandex.ru>
Fri, 4 Dec 2009 14:32:54 +0000 (17:32 +0300)
bgpd/bgp_aspath.c

index 440815b4682025741492756969f26862230c766c..3c8032f8d1f3065bba3c5c07fb4c830b9a6e3857 100644 (file)
@@ -728,8 +728,11 @@ assegments_parse (struct stream *s, size_t length, int use32bit)
       if ( ((bytes + seg_size) > length)
           /* 1771bis 4.3b: seg length contains one or more */
           || (segh.length == 0) 
-          /* Paranoia in case someone changes type of segment length */
-          || ((sizeof segh.length > 1) && (segh.length > AS_SEGMENT_MAX)) )
+          /* Paranoia in case someone changes type of segment length.
+           * Shift both values by 0x10 to make the comparison operate
+           * on more, than 8 bits (otherwise it's a warning, bug #564).
+           */
+          || ((sizeof segh.length > 1) && (0x10 + segh.length > 0x10 + AS_SEGMENT_MAX)) )
         {
           if (head)
             assegment_free_all (head);