diff options
author | Maria Matejka <mq@ucw.cz> | 2022-05-30 15:36:54 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-30 15:36:54 +0200 |
commit | 45af19dd99b3c8f954621e09075e8be180e2f731 (patch) | |
tree | 2e25c82a8e13080d589c79ec0478e5127a9404fb /proto/babel/babel.c | |
parent | ef3a8138c909baf58c61ddf2edd815eab899d3a6 (diff) | |
parent | 652be92a21f5575e5f74f6abe98eb4200b86776c (diff) |
Merge commit '652be92a21f5575e5f74f6abe98eb4200b86776c' into haugesund
Diffstat (limited to 'proto/babel/babel.c')
-rw-r--r-- | proto/babel/babel.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c index a8ca9e52..db54e4f1 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -862,14 +862,14 @@ babel_send_ihus(struct babel_iface *ifa) } static void -babel_send_hello(struct babel_iface *ifa) +babel_send_hello(struct babel_iface *ifa, uint interval) { struct babel_proto *p = ifa->proto; union babel_msg msg = {}; msg.type = BABEL_TLV_HELLO; msg.hello.seqno = ifa->hello_seqno++; - msg.hello.interval = ifa->cf->hello_interval; + msg.hello.interval = interval ?: ifa->cf->hello_interval; TRACE(D_PACKETS, "Sending hello on %s with seqno %d interval %t", ifa->ifname, msg.hello.seqno, (btime) msg.hello.interval); @@ -1577,7 +1577,7 @@ babel_iface_timer(timer *t) if (now_ >= ifa->next_hello) { - babel_send_hello(ifa); + babel_send_hello(ifa, 0); ifa->next_hello += hello_period * (1 + (now_ - ifa->next_hello) / hello_period); } @@ -1624,7 +1624,7 @@ babel_iface_start(struct babel_iface *ifa) tm_start(ifa->timer, 100 MS); ifa->up = 1; - babel_send_hello(ifa); + babel_send_hello(ifa, 0); babel_send_wildcard_retraction(ifa); babel_send_wildcard_request(ifa); babel_send_update(ifa, 0); /* Full update */ @@ -2435,6 +2435,11 @@ babel_iface_shutdown(struct babel_iface *ifa) { if (ifa->sk) { + /* + * Retract all our routes and lower the hello interval so peers' neighbour + * state expires quickly + */ + babel_send_hello(ifa, BABEL_MIN_INTERVAL); babel_send_wildcard_retraction(ifa); babel_send_queue(ifa); } |