public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: free neighbors when an interface is deactivated
@ 2011-01-15 14:52 Marek Lindner
  2011-01-16 10:27 ` Marek Lindner
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Lindner @ 2011-01-15 14:52 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Marek Lindner

hardif_disable_interface() calls purge_orig_ref() to immediately free
all neighbors associated with the interface that is going down.
purge_orig_neighbors() checked if the interface status is IF_INACTIVE
which is set to IF_NOT_IN_USE shortly before calling purge_orig_ref().

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---
 batman-adv/hard-interface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/batman-adv/hard-interface.c b/batman-adv/hard-interface.c
index 4f95777..52b2b72 100644
--- a/batman-adv/hard-interface.c
+++ b/batman-adv/hard-interface.c
@@ -398,7 +398,6 @@ void hardif_disable_interface(struct batman_if *batman_if)
 
 	kfree(batman_if->packet_buff);
 	batman_if->packet_buff = NULL;
-	batman_if->if_status = IF_NOT_IN_USE;
 
 	/* delete all references to this batman_if */
 	purge_orig_ref(bat_priv);
@@ -410,6 +409,7 @@ void hardif_disable_interface(struct batman_if *batman_if)
 		softif_destroy(batman_if->soft_iface);
 
 	batman_if->soft_iface = NULL;
+	batman_if->if_status = IF_NOT_IN_USE;
 }
 
 static struct batman_if *hardif_add_interface(struct net_device *net_dev)
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [B.A.T.M.A.N.] [PATCH] batman-adv: free neighbors when an interface is deactivated
  2011-01-15 14:52 [B.A.T.M.A.N.] [PATCH] batman-adv: free neighbors when an interface is deactivated Marek Lindner
@ 2011-01-16 10:27 ` Marek Lindner
  2011-01-19 19:13   ` Marek Lindner
  0 siblings, 1 reply; 3+ messages in thread
From: Marek Lindner @ 2011-01-16 10:27 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Marek Lindner

hardif_disable_interface() calls purge_orig_ref() to immediately free
all neighbors associated with the interface that is going down.
purge_orig_neighbors() checked if the interface status is IF_INACTIVE
which is set to IF_NOT_IN_USE shortly before calling purge_orig_ref().

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
---

Note: The previous patch created a new problem when cleaning up pending
OGMs, therefore this different approach.

 batman-adv/originator.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/batman-adv/originator.c b/batman-adv/originator.c
index c043bf8..1840f3a 100644
--- a/batman-adv/originator.c
+++ b/batman-adv/originator.c
@@ -224,10 +224,15 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv,
 		if ((time_after(jiffies,
 			neigh_node->last_valid + PURGE_TIMEOUT * HZ)) ||
 		    (neigh_node->if_incoming->if_status == IF_INACTIVE) ||
+		    (neigh_node->if_incoming->if_status == IF_NOT_IN_USE) ||
 		    (neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) {
 
-			if (neigh_node->if_incoming->if_status ==
-							IF_TO_BE_REMOVED)
+			if ((neigh_node->if_incoming->if_status ==
+								IF_INACTIVE) ||
+			    (neigh_node->if_incoming->if_status ==
+							IF_NOT_IN_USE) ||
+			    (neigh_node->if_incoming->if_status ==
+							IF_TO_BE_REMOVED))
 				bat_dbg(DBG_BATMAN, bat_priv,
 					"neighbor purge: originator %pM, "
 					"neighbor: %pM, iface: %s\n",
-- 
1.7.2.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: free neighbors when an interface is deactivated
  2011-01-16 10:27 ` Marek Lindner
@ 2011-01-19 19:13   ` Marek Lindner
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Lindner @ 2011-01-19 19:13 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

On Sunday 16 January 2011 11:27:52 Marek Lindner wrote:
> hardif_disable_interface() calls purge_orig_ref() to immediately free
> all neighbors associated with the interface that is going down.
> purge_orig_neighbors() checked if the interface status is IF_INACTIVE
> which is set to IF_NOT_IN_USE shortly before calling purge_orig_ref().

Applied in revision 1903.

Regards,
Marek

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-01-19 19:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-15 14:52 [B.A.T.M.A.N.] [PATCH] batman-adv: free neighbors when an interface is deactivated Marek Lindner
2011-01-16 10:27 ` Marek Lindner
2011-01-19 19:13   ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox