From: Ondrej Zajicek (work) Date: Fri, 13 Oct 2017 17:33:42 +0000 (+0200) Subject: Babel: Fix Hello and IHU expiration X-Git-Tag: v2.0.0~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ee69d11f2e859b77ff04bb4068f43082fd1794f;p=thirdparty%2Fbird.git Babel: Fix Hello and IHU expiration --- diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 8a39f022e..109744743 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -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 diff --git a/proto/babel/babel.h b/proto/babel/babel.h index 95ea3036f..1b857f099 100644 --- a/proto/babel/babel.h +++ b/proto/babel/babel.h @@ -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;