diff options
author | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-07-20 15:55:45 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-07-20 15:55:45 +0200 |
commit | 13a31a4001e02ea7c84d26cbeaaa9fea816736f7 (patch) | |
tree | 0ae98d8a64da91c985b5368252ae104ef2f1a4f6 /proto | |
parent | a08a81c6b40dcf07e786b67e5015fc91a44333ca (diff) |
Babel: Immediately update hello interval on interface reconfigure
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@toke.dk>
Diffstat (limited to 'proto')
-rw-r--r-- | proto/babel/babel.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 8164f2f3..9d73a264 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -1590,6 +1590,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; |