summaryrefslogtreecommitdiff
path: root/proto/babel
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 15:20:21 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 15:20:21 +0200
commit652be92a21f5575e5f74f6abe98eb4200b86776c (patch)
treeacf3dcdf931dad33bdef322565b74eb11079a529 /proto/babel
parentf196b12c62633e382541ba156e6df1534860c568 (diff)
parent9e60b500c76945ccdea94d3a67e7acfde5e3f969 (diff)
Merge remote-tracking branch 'origin/master' into haugesund-to-2.0
Diffstat (limited to 'proto/babel')
-rw-r--r--proto/babel/babel.c13
-rw-r--r--proto/babel/packets.c2
2 files changed, 10 insertions, 5 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 8040345f..1d3e4234 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -859,14 +859,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);
@@ -1574,7 +1574,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);
}
@@ -1621,7 +1621,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 */
@@ -2432,6 +2432,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);
}
diff --git a/proto/babel/packets.c b/proto/babel/packets.c
index 2a6d443d..d4acc170 100644
--- a/proto/babel/packets.c
+++ b/proto/babel/packets.c
@@ -2010,7 +2010,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);
}