the current implementation works as expected because once ogm_schedule() has been invoked once it will continue to invoke itself periodically thanks to the schedule (but not sent) packets.
A correct behaviour would be to wait for the interface to be ready for sending before scheduling the first OGM.
Moreover another routing algorithm may not schedule any packet because the interface is not active yet, and this would lead to a breakage in the interface activation procedure
Signed-off-by: Antonio Quartulli ordex@autistici.org --- hard-interface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/hard-interface.c b/hard-interface.c index d55213c..4a1a24b 100644 --- a/hard-interface.c +++ b/hard-interface.c @@ -339,6 +339,8 @@ batadv_hardif_activate_interface(struct batadv_hard_iface *hard_iface)
batadv_update_min_mtu(hard_iface->soft_iface);
+ /* begin scheduling originator messages on that interface */ + batadv_schedule_bat_ogm(hard_iface); out: if (primary_if) batadv_hardif_free_ref(primary_if); @@ -453,9 +455,6 @@ int batadv_hardif_enable_interface(struct batadv_hard_iface *hard_iface, "Not using interface %s (retrying later): interface not active\n", hard_iface->net_dev->name);
- /* begin scheduling originator messages on that interface */ - batadv_schedule_bat_ogm(hard_iface); - out: return 0;