From patchwork Sat Mar 5 12:28:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 849 Return-Path: Received: from v3-1039.vlinux.de (narfation.org [79.140.41.39]) by open-mesh.org (Postfix) with ESMTPS id 9C56315423D for ; Sat, 5 Mar 2011 13:29:31 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@narfation.org; dkim-adsp=pass Received: from sven-desktop.home.narfation.org (i59F6B254.versanet.de [89.246.178.84]) by v3-1039.vlinux.de (Postfix) with ESMTPSA id 79D70940C7; Sat, 5 Mar 2011 13:29:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=narfation.org; s=mail; t=1299328173; bh=g5BxjeeQQp4FSNnpKBMox+Q04aJcPB0r6Xon3uzqkUg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=OFS0fBWgpJT9CZAX4+IrfR/vBQz+pvosFsSzZF75QiPAH5213RWWpOnOF/1AyUKDm hqZpypWYKU06BYOsL8GP1wxHAfek0II9eekhrI+6pFNB7b3nP+IriJG6n2/gIosNzq LDwHVGqu8gBa/+Ma6t7wbxGtlYO5PvZvLYJhxftM= From: Sven Eckelmann To: davem@davemloft.net Date: Sat, 5 Mar 2011 13:28:19 +0100 Message-Id: <1299328122-21468-6-git-send-email-sven@narfation.org> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1299328122-21468-1-git-send-email-sven@narfation.org> References: <1299328122-21468-1-git-send-email-sven@narfation.org> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH 05/28] batman-adv: free neighbors when an interface is deactivated X-BeenThere: b.a.t.m.a.n@lists.open-mesh.org X-Mailman-Version: 2.1.13 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Mar 2011 12:29:32 -0000 From: 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 --- net/batman-adv/originator.c | 9 +++++++-- 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",