batman-adv: free neighbors when an interface is deactivated
authorMarek Lindner <lindner_marek@yahoo.de>
Wed, 19 Jan 2011 19:16:10 +0000 (19:16 +0000)
committerMarek Lindner <lindner_marek@yahoo.de>
Sat, 5 Mar 2011 11:49:55 +0000 (12:49 +0100)
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>
net/batman-adv/originator.c

index 6cb9af3f89e5f13933d0eda84bd4e0f21d4fc628..899d4943d8adacc7c1490e66f00169f61b217f1a 100644 (file)
@@ -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",