[PATCH 2/7] Babel: Immediately send a hello on interface reconfigure.
An interface reconfiguration may change the hello interval. Section 3.4.1 of the RFC specifies that either the change shouldn't be applied until the next hello is due, or an additional hello should be sent immediately. This does the latter. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> --- proto/babel/babel.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 8e104d6..4b28f69 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -1539,7 +1539,10 @@ babel_reconfigure_iface(struct babel_proto *p, struct babel_iface *ifa, struct b babel_iface_update_state(ifa); if (ifa->up) + { + babel_send_hello(ifa, 0); babel_iface_kick_timer(ifa); + } return 1; } -- 2.8.0
On Mon, May 02, 2016 at 07:07:50PM +0200, Toke Høiland-Jørgensen wrote:
An interface reconfiguration may change the hello interval. Section 3.4.1 of the RFC specifies that either the change shouldn't be applied until the next hello is due, or an additional hello should be sent immediately. This does the latter.
if (ifa->up) + { + babel_send_hello(ifa, 0); babel_iface_kick_timer(ifa); + }
I am not sure if this is correct - even if you add babel_send_hello(), the next hello is scheduled based on ifa->next_hello. It seems to me that the old code was correct - it waited based on old interval and then sent hello with the new value. The new code sends hello immediately with the new value, but then waits based on old interval (ifa->next_hello) for the next regular hello to send. -- Elen sila lumenn' omentielvo Ondrej 'Santiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
Ondrej Zajicek <santiago@crfreenet.org> writes:
On Mon, May 02, 2016 at 07:07:50PM +0200, Toke Høiland-Jørgensen wrote:
An interface reconfiguration may change the hello interval. Section 3.4.1 of the RFC specifies that either the change shouldn't be applied until the next hello is due, or an additional hello should be sent immediately. This does the latter.
if (ifa->up) + { + babel_send_hello(ifa, 0); babel_iface_kick_timer(ifa); + }
I am not sure if this is correct - even if you add babel_send_hello(), the next hello is scheduled based on ifa->next_hello.
It seems to me that the old code was correct - it waited based on old interval and then sent hello with the new value.
Yes, you're right. This was actually trying to fix an inconsistency where updates will immediately use the newly configured interval, but hellos will not. So figure the patch needs to also reset the timer. Will re-send with that added.
The new code sends hello immediately with the new value, but then waits based on old interval (ifa->next_hello) for the next regular hello to send.
Yeah, the old code was not technically out of spec, it was just inconsistent. Seems the patch is just incomplete for fixing that. :) -Toke
participants (2)
-
Ondrej Zajicek -
Toke Høiland-Jørgensen