From patchwork Sun Dec 4 11:26:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1390 Return-Path: Received: from latitanza.investici.org (latitanza.investici.org [82.94.249.234]) by open-mesh.org (Postfix) with ESMTPS id 8800D600779 for ; Sun, 4 Dec 2011 12:27:11 +0100 (CET) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [82.94.249.234] (latitanza [82.94.249.234]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id BD20898387; Sun, 4 Dec 2011 11:27:10 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 latitanza.investici.org BD20898387 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1322998031; bh=Kr37c/JwtBdlzTIP/j39dEeHS5qnqmW/PnWrnB5At4U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=VesJbIbAGPmYZ5viuemObbQs0WYiSXuSpOGXEHnGP/5LKNYZN9h7oeDEfLnm46Bbp SSP7lpWOeKVEWQG/qXjfmoEBTscT4SDXrgjMEuXnE2PYFZkW98XiJjegxukyzFDRj8 gN/nexUw1NCgZGHl0o3NDIKQGs5pvaJNIWVr81x4= From: Antonio Quartulli To: b.a.t.m.a.n@lists.open-mesh.org Date: Sun, 4 Dec 2011 12:26:50 +0100 Message-Id: <1322998010-19221-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1322945658-25154-1-git-send-email-ordex@autistici.org> References: <1322945658-25154-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCHv2] 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: Sun, 04 Dec 2011 11:27:11 -0000 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. Signed-off-by: Antonio Quartulli --- * commit message improved translation-table.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/translation-table.c b/translation-table.c index 7a7df4a..cf3e2c2 100644 --- a/translation-table.c +++ b/translation-table.c @@ -242,9 +242,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->common.flags |= TT_CLIENT_PENDING; + tt_global_entry->common.flags |= TT_CLIENT_ROAM; + tt_global_entry->roam_at = jiffies; + send_roam_adv(bat_priv, tt_global_entry->common.addr, tt_global_entry->orig_node); }