summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-06-13 14:47:37 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-06-13 14:47:37 +0200
commit9c9050ff12c52762708dadda78a05108a5b533b2 (patch)
treeb56325a0eec88ce00ec72d2a973e1dd27c71f0ba
parent18b4f2082c30586890596988086fbc3e15336526 (diff)
BGP: Handle missing NEXT_HOP attribute properly
RFC 7606 specifies handle-as-withdraw instead of session reset.
-rw-r--r--proto/bgp/attrs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/proto/bgp/attrs.c b/proto/bgp/attrs.c
index 9003feb2..d7a4e692 100644
--- a/proto/bgp/attrs.c
+++ b/proto/bgp/attrs.c
@@ -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)