batman-adv: invoke ogm_schedule() only when the interface is activated
PATCH 1/1 batman-adv: invoke ogm_schedule() only when the interface is activated
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 <[email protected]>
--- hard-interface.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
hard-interface.c +2 -3
@@ -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 ;
Signature · 1 line
1.8.1.5