summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-11-08 14:15:11 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-07 13:53:42 +0100
commit672fb78e1272bb49cc2521176effe75e3cb22460 (patch)
tree76ed92b9dbba42e218cb1621f4b13c2afb37b8ab
parent268dc7c8b3c45412fc8f4b0bae451e51c4c48b31 (diff)
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.
-rw-r--r--proto/babel/packets.c4
1 files 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 */