]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: ignore 4 bits of attribute flags byte
authorDenis Ovsienko <infrastation@yandex.ru>
Tue, 27 Sep 2011 11:35:39 +0000 (15:35 +0400)
committerDenis Ovsienko <infrastation@yandex.ru>
Mon, 17 Oct 2011 14:27:32 +0000 (18:27 +0400)
bgpd/bgp_attr.c

index 1300ab84ba3895326264a97da7a3033cb3e6d60a..251f15680b98fbd61d6c115dc96b1d0d6e2efc1e 100644 (file)
@@ -1697,7 +1697,10 @@ bgp_attr_parse (struct peer *peer, struct attr *attr, bgp_size_t size,
 
       /* Fetch attribute flag and type. */
       startp = BGP_INPUT_PNT (peer);
-      flag = stream_getc (BGP_INPUT (peer));
+      /* "The lower-order four bits of the Attribute Flags octet are
+         unused.  They MUST be zero when sent and MUST be ignored when
+         received." */
+      flag = 0xF0 & stream_getc (BGP_INPUT (peer));
       type = stream_getc (BGP_INPUT (peer));
 
       /* Check whether Extended-Length applies and is in bounds */