Babel: Fix Hello and IHU expiration

This commit is contained in:
Ondrej Zajicek (work) 2017-10-13 19:33:42 +02:00
parent 8b58f565e4
commit 5ee69d11f2
2 changed files with 6 additions and 1 deletions

View file

@ -343,6 +343,7 @@ static void
babel_expire_ihu(struct babel_neighbor *nbr) babel_expire_ihu(struct babel_neighbor *nbr)
{ {
nbr->txcost = BABEL_INFINITY; nbr->txcost = BABEL_INFINITY;
nbr->ihu_expiry = 0;
} }
static void static void
@ -353,7 +354,9 @@ babel_expire_hello(struct babel_neighbor *nbr)
if (nbr->hello_cnt < 16) if (nbr->hello_cnt < 16)
nbr->hello_cnt++; nbr->hello_cnt++;
if (!nbr->hello_map) if (nbr->hello_map)
nbr->hello_expiry += nbr->last_hello_int;
else
babel_flush_neighbor(nbr); 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; n->next_hello_seqno = seqno+1;
if (n->hello_cnt < 16) n->hello_cnt++; if (n->hello_cnt < 16) n->hello_cnt++;
n->hello_expiry = current_time() + BABEL_HELLO_EXPIRY_FACTOR(interval); n->hello_expiry = current_time() + BABEL_HELLO_EXPIRY_FACTOR(interval);
n->last_hello_int = interval;
} }
static void static void

View file

@ -191,6 +191,7 @@ struct babel_neighbor {
u8 hello_cnt; u8 hello_cnt;
u16 hello_map; u16 hello_map;
u16 next_hello_seqno; u16 next_hello_seqno;
uint last_hello_int;
/* expiry timers */ /* expiry timers */
btime hello_expiry; btime hello_expiry;
btime ihu_expiry; btime ihu_expiry;