diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-07-19 13:33:02 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-07-19 13:33:02 +0200 |
commit | ecae2f43f37df642e5098201a0472802e6a70e78 (patch) | |
tree | 589e95b3a2093cb21cf0da6c8a2470e9c72ed09d /proto/babel/packets.c | |
parent | 12640c149976e1eca54d9c22c593d07a27c49d42 (diff) |
Babel: Rework handling of retractions
An update with wildcard AE and infinite metric should be treated as a
global retraction of all prefixes announced by that neighbour, per
section 4.4.9 of the RFC. In addition, router ID and seqno in retraction
updates should be ignored. This reworks the handling of retractions and
adjusts the parser to handle all this correctly.
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Diffstat (limited to 'proto/babel/packets.c')
-rw-r--r-- | proto/babel/packets.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/proto/babel/packets.c b/proto/babel/packets.c index be47aa75..d0cc613e 100644 --- a/proto/babel/packets.c +++ b/proto/babel/packets.c @@ -480,6 +480,7 @@ babel_read_update(struct babel_tlv *hdr, union babel_msg *m, if (tlv->plen > 0) return PARSE_ERROR; + msg->plen = 0; msg->prefix = IPA_NONE; break; @@ -523,7 +524,8 @@ babel_read_update(struct babel_tlv *hdr, union babel_msg *m, return PARSE_IGNORE; } - if (!state->router_id_seen) + /* Update must have Router ID, unless it is retraction */ + if (!state->router_id_seen && (msg->metric != BABEL_INFINITY)) { DBG("Babel: No router ID seen before update\n"); return PARSE_ERROR; |