From patchwork Mon Oct 10 12:19:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1282 Return-Path: Received: from contumacia.investici.org (contumacia.investici.org [178.255.144.35]) by open-mesh.org (Postfix) with ESMTPS id 0390B6007B2 for ; Mon, 10 Oct 2011 14:20:52 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [178.255.144.35] (contumacia [178.255.144.35]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id 38883E837A; Mon, 10 Oct 2011 12:20:52 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 contumacia.investici.org 38883E837A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1318249252; bh=cIpt5DH/viqS4UaCrORBBBHO3oTc6E4AUUNnJAGszXQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=IUBZauKZq9eA5J9+iVMx+4X19vNiVwYBZsZ1zLZE1iosjWbskbDcB6aUTBmEgpsPQ 0/BIG8kDLf3E9BYRLu3voYELW1Wqd4C7C8HQVFx4JLOpzzgiWSXetx9QRtttOTLg7t MWPQ6BwjkcXaDXS6GZDOoaW7lLbSX+Uruzx3Q0s4= From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Mon, 10 Oct 2011 14:19:48 +0200 Message-Id: <1318249188-14954-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <20111010120849.GA10057@ritirata.org> References: <20111010120849.GA10057@ritirata.org> Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: fix tt_local_reset_flags() function 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: Mon, 10 Oct 2011 12:20:53 -0000 tt_local_num has to be increased only the when flag passed as argument is reset Signed-off-by: Antonio Quartulli --- This patch should fix the aforementioned bug. Please the testers to give it a try :-) We are waiting for feedbacks! translation-table.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/translation-table.c b/translation-table.c index 7de9960..8451ecd 100644 --- a/translation-table.c +++ b/translation-table.c @@ -1723,6 +1723,8 @@ static void tt_local_reset_flags(struct bat_priv *bat_priv, uint16_t flags) rcu_read_lock(); hlist_for_each_entry_rcu(tt_local_entry, node, head, hash_entry) { + if (!(tt_local_entry->flags & flags)) + continue; tt_local_entry->flags &= ~flags; atomic_inc(&bat_priv->num_local_tt); }