From 4aef70136d8bae68e171fa7178889e6ad9fff9b8 Mon Sep 17 00:00:00 2001 From: Toke Høiland-Jørgensen Date: Fri, 22 Apr 2022 16:41:52 +0200 Subject: Babel: Send out low-interval hello on shutdown When shutting down a Babel instance we send a wildcard retraction to make sure all peers can quickly switch to other route origins. Add another small optimisation borrowed from babeld: sending a Hello message (along with the retraction) with a very low interval. This will cause neighbours to modify their expiry timers for the node's state to quickly time it out, thus conserving resources in the network. --- proto/babel/babel.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 174fc9e2..4a7d550f 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -842,14 +842,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); @@ -1557,7 +1557,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); } @@ -1604,7 +1604,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 */ @@ -2417,6 +2417,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); } -- cgit v1.2.3 From d8298001389f021f68ead1ed2b4809edb60ae416 Mon Sep 17 00:00:00 2001 From: Toke Høiland-Jørgensen Date: Fri, 22 Apr 2022 17:04:56 +0200 Subject: Babel: Fix compilation when LOCAL_DEBUG is set in packets.c The debug output was not updated with the rest of the code, so packets.c fails to compile if LOCAL_DEBUG is set. --- proto/babel/packets.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proto/babel/packets.c b/proto/babel/packets.c index f13410e2..2647a79f 100644 --- a/proto/babel/packets.c +++ b/proto/babel/packets.c @@ -2011,7 +2011,7 @@ babel_auth_sign(struct babel_iface *ifa, ip_addr dest) } DBG("Added MAC signatures (%d bytes) on ifa %s for dest %I\n", - tot_len, ifa->ifname, dest); + pos - (pkt + len), ifa->ifname, dest); return pos - (pkt + len); } -- cgit v1.2.3 From 207ac4853316ceffa6d56ff06f8904320d3bf45f Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 22 Apr 2022 17:06:27 +0200 Subject: Doc: fix mating -> matching in flowspec section --- doc/bird.sgml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/bird.sgml b/doc/bird.sgml index 9c4a6f68..1580facd 100644 --- a/doc/bird.sgml +++ b/doc/bird.sgml @@ -5251,7 +5251,7 @@ Note that for negated matches, value must be either zero or equal to bitmask port 1..1023,1194,3306).