]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
BGP: Handle missing NEXT_HOP attribute properly
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 13 Jun 2018 12:47:37 +0000 (14:47 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 13 Jun 2018 12:47:37 +0000 (14:47 +0200)
RFC 7606 specifies handle-as-withdraw instead of session reset.

proto/bgp/attrs.c

index 9003feb2dcc0df2f392cef8d7a85b99ea7fedda8..d7a4e692e1fb77307cae7b0655c7a68fd14e09fc 100644 (file)
@@ -1109,6 +1109,9 @@ bgp_decode_attrs(struct bgp_parse_state *s, byte *data, uint len)
   if (!BIT32_TEST(s->attrs_seen, BA_AS_PATH))
   { REPORT(NO_MANDATORY, "AS_PATH"); goto withdraw; }
 
+  if (s->ip_reach_len && !BIT32_TEST(s->attrs_seen, BA_NEXT_HOP))
+  { REPORT(NO_MANDATORY, "NEXT_HOP"); goto withdraw; }
+
   /* When receiving attributes from non-AS4-aware BGP speaker, we have to
      reconstruct AS_PATH and AGGREGATOR attributes; RFC 6793 4.2.3 */
   if (!p->as4_session)