summaryrefslogtreecommitdiff
path: root/proto/babel/babel.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2017-10-13 19:33:42 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2017-12-07 13:53:42 +0100
commit5ee69d11f2e859b77ff04bb4068f43082fd1794f (patch)
treefda0d5f87307d733ecfd830ad8996a9e6d176544 /proto/babel/babel.c
parent8b58f565e4fcd076e2d9fe008c7f2b19e264b319 (diff)
Babel: Fix Hello and IHU expiration
Diffstat (limited to 'proto/babel/babel.c')
-rw-r--r--proto/babel/babel.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c
index 8a39f022..10974474 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