From patchwork Sun Jan 16 10:27:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 688 Return-Path: Received: from nm16.bullet.mail.ukl.yahoo.com (nm16.bullet.mail.ukl.yahoo.com [217.146.183.190]) by open-mesh.org (Postfix) with SMTP id 65E8D1545EF for ; Sun, 16 Jan 2011 11:31:11 +0100 (CET) Received: from [217.146.183.209] by nm16.bullet.mail.ukl.yahoo.com with NNFMP; 16 Jan 2011 10:31:10 -0000 Received: from [77.238.184.64] by tm2.bullet.mail.ukl.yahoo.com with NNFMP; 16 Jan 2011 10:31:10 -0000 Received: from [127.0.0.1] by smtp133.mail.ukl.yahoo.com with NNFMP; 16 Jan 2011 10:31:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1295173870; bh=3sY95BCcer629EsEKYtaDfU6KTPFxMjsphwHYYr+JYw=; h=X-Yahoo-Newman-Id:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=LgKyGsJXq9+k8JOkFtmzoCE9H1QOOweCbqq29fF2fqmpkQ3lnHRfe7HObIys25o0+c0lI/KlDdRj1dLRJrZCl1szqnFeMnVMIXywHubfQhrHo11ZWb0cpK4Zkt5//+JnQ3tyMVGf7bdP9OffMxciza8DPP4+W01F+f4iRrHoHn0= X-Yahoo-Newman-Id: 207745.65529.bm@smtp133.mail.ukl.yahoo.com Received: from localhost (lindner_marek@81.57.254.118 with plain) by smtp133.mail.ukl.yahoo.com with SMTP; 16 Jan 2011 10:31:06 +0000 GMT X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- X-YMail-OSG: qeZeumUVM1n9Xb5wqaNRaw5X3ofiqLse9ngPg.xViXGoEef Vbd3ZfmZuA9IhXdQU4sv443UjVFXB2kaqjXTyQr21sSdtLKEK7kLOE8aw2Ap Qr5gMusVps3eJSRvuBftAkKQbfDBTDnTAU.y2z2SuGGXVxgKsgQbKSO0CEpr 2taPjajKY3yLQWY4fdhVwOWIflf8Cx.j6ex7NZVSCntr5q4JUyGF_00NhjAA U7auSBshZ4kNB3gT1h56I7p4txQ_ROemm1Kf2x9drYVQuu4OfQ.RdgP8pUtL bzFaZJd9EihmJp4Q- X-Yahoo-Newman-Property: ymail-3 From: Marek Lindner To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 16 Jan 2011 11:27:52 +0100 Message-Id: <1295173672-16895-1-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1295103173-7036-1-git-send-email-lindner_marek@yahoo.de> References: <1295103173-7036-1-git-send-email-lindner_marek@yahoo.de> Cc: Marek Lindner Subject: [B.A.T.M.A.N.] [PATCH] 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.11 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: Sun, 16 Jan 2011 10:31:13 -0000 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 --- 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",