]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Babel: Fix Hello and IHU expiration
authorOndrej Zajicek (work) <santiago@crfreenet.org>
Fri, 13 Oct 2017 17:33:42 +0000 (19:33 +0200)
committerOndrej Zajicek (work) <santiago@crfreenet.org>
Thu, 7 Dec 2017 12:53:42 +0000 (13:53 +0100)
proto/babel/babel.c
proto/babel/babel.h

index 8a39f022e66c9aa0f02593f9247aff7eebe1dc82..109744743e1b760238e4a34fbd3dfc3f9451273d 100644 (file)
@@ -343,6 +343,7 @@ static void
 babel_expire_ihu(struct babel_neighbor *nbr)
 {
   nbr->txcost = BABEL_INFINITY;
+  nbr->ihu_expiry = 0;
 }
 
 static void
@@ -353,7 +354,9 @@ babel_expire_hello(struct babel_neighbor *nbr)
   if (nbr->hello_cnt < 16)
     nbr->hello_cnt++;
 
-  if (!nbr->hello_map)
+  if (nbr->hello_map)
+    nbr->hello_expiry += nbr->last_hello_int;
+  else
     babel_flush_neighbor(nbr);
 }
 
@@ -929,6 +932,7 @@ babel_update_hello_history(struct babel_neighbor *n, u16 seqno, uint interval)
   n->next_hello_seqno = seqno+1;
   if (n->hello_cnt < 16) n->hello_cnt++;
   n->hello_expiry = current_time() + BABEL_HELLO_EXPIRY_FACTOR(interval);
+  n->last_hello_int = interval;
 }
 
 static void
index 95ea3036f35d9cf0f66a9b750d5eb03dc1f80d32..1b857f099ef84d823804c49e5abb89a8448d7258 100644 (file)
@@ -191,6 +191,7 @@ struct babel_neighbor {
   u8 hello_cnt;
   u16 hello_map;
   u16 next_hello_seqno;
+  uint last_hello_int;
   /* expiry timers */
   btime hello_expiry;
   btime ihu_expiry;