[PATCH v2] Babel: Immediately update hello interval on interface reconfigure.

Toke Høiland-Jørgensen toke at toke.dk
Tue Jul 19 18:34:44 CEST 2016


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 at toke.dk>
---
 proto/babel/babel.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 8e104d6..15451ab 100644
--- a/proto/babel/babel.c
+++ b/proto/babel/babel.c
@@ -1529,6 +1529,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;
 
@@ -1538,8 +1541,10 @@ babel_reconfigure_iface(struct babel_proto *p, struct babel_iface *ifa, struct b
   if (new->check_link != old->check_link)
     babel_iface_update_state(ifa);
 
-  if (ifa->up)
+  if (ifa->up) {
+    babel_send_hello(ifa, 0)
     babel_iface_kick_timer(ifa);
+  }
 
   return 1;
 }
-- 
2.9.0



More information about the Bird-users mailing list