From 672fb78e1272bb49cc2521176effe75e3cb22460 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Wed, 8 Nov 2017 14:15:11 +0100 Subject: [PATCH] Babel: Fix handling of IPv4 retractions Babel TLV parsing code rejected IPv4 retractions without next-hop, although next-hop is needed just for regular updates. --- proto/babel/packets.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proto/babel/packets.c b/proto/babel/packets.c index 6e8d2eb5..8e972db2 100644 --- a/proto/babel/packets.c +++ b/proto/babel/packets.c @@ -593,8 +593,8 @@ babel_read_update(struct babel_tlv *hdr, union babel_msg *m, if (tlv->omitted && !state->def_ip4_prefix_seen) return PARSE_ERROR; - /* Need next hop for v4 routes */ - if (ipa_zero(state->next_hop_ip4)) + /* Update must have next hop, unless it is retraction */ + if (ipa_zero(state->next_hop_ip4) && (msg->metric != BABEL_INFINITY)) return PARSE_ERROR; /* Merge saved prefix and received prefix parts */