b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [RFC] batman-adv: invoke ogm_schedule() only when the interface is activated
@ 2014-02-10  9:33 Antonio Quartulli
  0 siblings, 0 replies; only message in thread
From: Antonio Quartulli @ 2014-02-10  9:33 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Antonio Quartulli, Antonio Quartulli

From: Antonio Quartulli <ordex@autistici.org>

In the current implementation the first OGM is scheduled
when a new hard-interface is enabled, no matter if it is
active (thus ready for sending packets) or not.
The B.A.T.M.A.N. IV scheduling mechanism works in a way
that reschedules the task forever even if the interface is
not active and therefore everything works as expected.

Unfortunately this behaviour is not fine for other
algorithms which may expect the interface to be active
before scheduling the first OGM.

Therefore change this behaviour by scheduling the first OGM
on interface activation.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
 hard-interface.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/hard-interface.c b/hard-interface.c
index b851cc5..2a04130 100644
--- a/hard-interface.c
+++ b/hard-interface.c
@@ -320,6 +320,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);
@@ -459,9 +461,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;
 
-- 
1.8.5.4


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-02-10  9:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-10  9:33 [B.A.T.M.A.N.] [RFC] batman-adv: invoke ogm_schedule() only when the interface is activated Antonio Quartulli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).