Browse Source

bgpd: set BGP_ATTR_MP_[UN]REACH_NLRI (fixes 1a211cb)

Unfortunately, the attribute present bits for MP_REACH and MP_UNREACH
which 1a211cb ("bgpd: one more fix"...) tests for are never set in their
corresponding attribute parsing functions.

Reported-by: Martin Winter <mwinter@netdef.org>
Fixes: 1a211cb "bgpd: one more fix for tightening of check for missing well-known attributes"
Cc: Paul Jakma <paul@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
David Lamparter 6 years ago
parent
commit
daefeb8755
1 changed files with 5 additions and 0 deletions
  1. 5 0
      bgpd/bgp_attr.c

+ 5 - 0
bgpd/bgp_attr.c

@@ -1591,6 +1591,8 @@ bgp_mp_reach_parse (struct bgp_attr_parser_args *args,
 
   stream_forward_getp (s, nlri_len);
 
+  attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_MP_REACH_NLRI);
+
   return BGP_ATTR_PARSE_PROCEED;
 #undef LEN_LEFT
 }
@@ -1606,6 +1608,7 @@ bgp_mp_unreach_parse (struct bgp_attr_parser_args *args,
   u_int16_t withdraw_len;
   int ret;
   struct peer *const peer = args->peer;  
+  struct attr *const attr = args->attr;
   const bgp_size_t length = args->length;
 
   s = peer->ibuf;
@@ -1633,6 +1636,8 @@ bgp_mp_unreach_parse (struct bgp_attr_parser_args *args,
 
   stream_forward_getp (s, withdraw_len);
 
+  attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_MP_UNREACH_NLRI);
+
   return BGP_ATTR_PARSE_PROCEED;
 }