]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Babel: Immediately update hello interval on interface reconfigure
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 20 Jul 2016 13:55:45 +0000 (15:55 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Wed, 20 Jul 2016 13:55:45 +0000 (15:55 +0200)
An interface reconfiguration may change both the hello and update
intervals. An update interval change is immediately put into effect,
while a hello interval change is not. This also updates the hello
interval immediately (if the new interval is shorter than the old one),
and sends a hello to notify peers of the change.

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
proto/babel/babel.c

index 8164f2f3c287612e5ca2890790771ef71e49c45c..9d73a2642cc5f77896108d29b9446430e51089aa 100644 (file)
@@ -1590,6 +1590,9 @@ babel_reconfigure_iface(struct babel_proto *p, struct babel_iface *ifa, struct b
 
   ifa->cf = new;
 
+  if (ifa->next_hello > (now + new->hello_interval))
+    ifa->next_hello = now + (random() % new->hello_interval) + 1;
+
   if (ifa->next_regular > (now + new->update_interval))
     ifa->next_regular = now + (random() % new->update_interval) + 1;