summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Lindner <lindner_marek@yahoo.de>2011-01-19 19:16:10 +0000
committerMarek Lindner <lindner_marek@yahoo.de>2011-03-05 12:49:55 +0100
commit1a241a57be46cda985c7c36e24d49f67de6bfb53 (patch)
tree51e88b4e7d17331497c4aab98f281353ab3f28d9
parentf987ed6ebd991009cd9f6190ce319e8b50d6be1f (diff)
downloadop-kernel-dev-1a241a57be46cda985c7c36e24d49f67de6bfb53.zip
op-kernel-dev-1a241a57be46cda985c7c36e24d49f67de6bfb53.tar.gz
batman-adv: free neighbors when an interface is deactivated
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>
-rw-r--r--net/batman-adv/originator.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 6cb9af3..899d494 100644
--- a/net/batman-adv/originator.c
+++ b/net/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",
OpenPOWER on IntegriCloud