From patchwork Wed Dec 7 05:42:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1425 Return-Path: Received: from nm21-vm3.bullet.mail.ukl.yahoo.com (nm21-vm3.bullet.mail.ukl.yahoo.com [217.12.10.35]) by open-mesh.org (Postfix) with SMTP id AB4496008A5 for ; Wed, 7 Dec 2011 06:42:32 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.180] by nm21.bullet.mail.ukl.yahoo.com with NNFMP; 07 Dec 2011 05:42:32 -0000 Received: from [77.238.184.74] by tm11.bullet.mail.ukl.yahoo.com with NNFMP; 07 Dec 2011 05:42:32 -0000 Received: from [127.0.0.1] by smtp143.mail.ukl.yahoo.com with NNFMP; 07 Dec 2011 05:42:32 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1323236552; bh=UCVTw9u8BBfpmizGnJx7lZhE5j1r3ScjBEYY3+kliSs=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:From:To:Cc:Subject:Date:Message-Id:X-Mailer:In-Reply-To:References; b=NZcc7HW6YEjWTa/pu7otit9zBEW/own4bdPNKoy9a3824JaVxZk38Lz7vDZIe52V92TgPz+HWefGy2ktdsDlQMx+PbgYDE8jONwNFkp6fLDSgTMQxtIpBLnGTPK0SlP9GFZBGYTJNN8nUgujQzHO/ZzlNrdyYUv9qeMU1C9lGMw= X-Yahoo-Newman-Id: 310012.93062.bm@smtp143.mail.ukl.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: qRR3NfMVM1kIrSs7YzVn3yhzyclR9UXW20lG3.WnRW0QwTw aickM1lJa4bkV7rnj0s8P93wn_vbemeaYOl9WLKtK.I0xRtkM9OJWdI9jwT3 ghoRFDOBP8fYEQa_7IY4QjfmuDLWN7aX2K.xAZ7UNF5aWI.1Lmto.wHUF.te qg0HX6x4PtlGH0PdvYiEmvrkXP7jr_CxlXKZ3zfeEM4E1XNrW3IUSnfr6I9S dlq310RwEW8Qm51yGNPl.AH87D1R73.VeT.CyzR3vh1WwbIW5isxS9wT8qLN yyn2SPJaDTB2BdBghbqShZ.PnQ94XiHZG4IOHq7pdtk63ymhM9XRGdFb_99j MsvW8TP2EUAbQwPwQkYj_vGC_oQnxz7b3K0dp83lvhEXGFSmrDcE.Xw-- X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- Received: from localhost (lindner_marek@210.177.7.38 with plain) by smtp143.mail.ukl.yahoo.com with SMTP; 07 Dec 2011 05:42:31 +0000 GMT From: Marek Lindner To: davem@davemloft.net Date: Wed, 7 Dec 2011 13:42:23 +0800 Message-Id: <1323236543-25215-1-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1323236203-24711-1-git-send-email-lindner_marek@yahoo.de> References: <1323236203-24711-1-git-send-email-lindner_marek@yahoo.de> Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org, stable@vger.kernel.org Subject: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: in case of roaming mark the client with TT_CLIENT_ROAM 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: Wed, 07 Dec 2011 05:42:32 -0000 From: Antonio Quartulli In case of a client roaming from node A to node B, the latter have to mark the corresponding global entry with TT_CLIENT_ROAM (instead of TT_CLIENT_PENDING). Marking a global entry with TT_CLIENT_PENDING will end up in keeping such entry forever (because this flag is only meant to be used with local entries and it is never checked on global ones). In the worst case (all the clients roaming to the same node A) the local and the global table will contain exactly the same clients. Batman-adv will continue to work, but the memory usage is duplicated. Cc: stable@vger.kernel.org Signed-off-by: Antonio Quartulli --- net/batman-adv/translation-table.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index c7aafc7..c46b140 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -245,9 +245,11 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr, if (tt_global_entry) { /* This node is probably going to update its tt table */ tt_global_entry->orig_node->tt_poss_change = true; - /* The global entry has to be marked as PENDING and has to be + /* The global entry has to be marked as ROAMING and has to be * kept for consistency purpose */ - tt_global_entry->flags |= TT_CLIENT_PENDING; + tt_global_entry->flags |= TT_CLIENT_ROAM; + tt_global_entry->roam_at = jiffies; + send_roam_adv(bat_priv, tt_global_entry->addr, tt_global_entry->orig_node); }