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.
This commit is contained in:
Ondrej Zajicek (work) 2017-11-08 14:15:11 +01:00
parent 268dc7c8b3
commit 672fb78e12

View file

@ -593,8 +593,8 @@ babel_read_update(struct babel_tlv *hdr, union babel_msg *m,
if (tlv->omitted && !state->def_ip4_prefix_seen) if (tlv->omitted && !state->def_ip4_prefix_seen)
return PARSE_ERROR; return PARSE_ERROR;
/* Need next hop for v4 routes */ /* Update must have next hop, unless it is retraction */
if (ipa_zero(state->next_hop_ip4)) if (ipa_zero(state->next_hop_ip4) && (msg->metric != BABEL_INFINITY))
return PARSE_ERROR; return PARSE_ERROR;
/* Merge saved prefix and received prefix parts */ /* Merge saved prefix and received prefix parts */