summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2011-09-27 15:35:39 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2011-09-30 10:32:02 +0400
commit2d42e68aa032ed2f11471aee444935918d35c8bb (patch)
treea58e0b96bdb43fb6ed66a94afc0d44b737ca4c89
parent214bcaa13e092d9fff8f233e62ba28ca7eefbc43 (diff)
bgpd: ignore 4 bits of attribute flags byte
-rw-r--r--bgpd/bgp_attr.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index aa4ce8f1..45a17fac 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -1788,7 +1788,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 */