From patchwork Thu Jul 7 22:33:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1227 Return-Path: Received: from nm15-vm0.bullet.mail.ukl.yahoo.com (nm15-vm0.bullet.mail.ukl.yahoo.com [217.146.183.252]) by open-mesh.org (Postfix) with SMTP id E807F15446C for ; Fri, 8 Jul 2011 00:34:07 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.216] by nm15.bullet.mail.ukl.yahoo.com with NNFMP; 07 Jul 2011 22:34:06 -0000 Received: from [77.238.184.75] by tm9.bullet.mail.ukl.yahoo.com with NNFMP; 07 Jul 2011 22:34:06 -0000 Received: from [127.0.0.1] by smtp144.mail.ukl.yahoo.com with NNFMP; 07 Jul 2011 22:34:06 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1310078046; bh=+NfHNxt2SxVAODCNC4928XrFytyPqYQhYI10PIrtaHQ=; 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=4efybOdtDdYCVq1nIj8hCVOxZUBO0BR+BTvj1MKRFEvHHvb27K0Dyl/nHtdNMYfmtAWYcVqzulGTDn0N/EUJigG42Szq6UCAfHUtIY9Y/EvHib04G+VAGjYEZ103iqjMv8L+o9h8wg559b50hfGiZx9y7e7od/vlBeg/Tq0f7ME= X-Yahoo-Newman-Id: 115020.1171.bm@smtp144.mail.ukl.yahoo.com Received: from localhost (lindner_marek@90.61.212.109 with plain) by smtp144.mail.ukl.yahoo.com with SMTP; 07 Jul 2011 22:34:05 +0000 GMT X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- X-YMail-OSG: R2dj.70VM1nm0RKYVA_H4dkesql6uNXaNbZclK1RBPyxk6g zo8In.sohUZS7WC.pBlAIiuCRGgCHS1pl16V82D.Ky.4rvUqsX0iZsCAXXvN 3neGdk11.af1guzWHpr7ACjxlS9Rr7IUXY5fy4ISmzmxhDI2mvLS1M1X6PIE lP7djePvWMHf5eZswdGjxOGCk4vTWh2fKDdzMOyqiB62jnFnmVet4XtAw_Cg AN12RLq28K5vcIkBRHlklUIu6htIxaoqMPbjsOzn1VIDhdJe3qwlIYiEWiOm U3Ejfiba2SscU_sCKY6YjQTocOhlyk1YunNmNxGpOCEzQjSSbWv1F7Cho.Lr i X-Yahoo-Newman-Property: ymail-3 From: Marek Lindner To: davem@davemloft.net Date: Fri, 8 Jul 2011 00:33:42 +0200 Message-Id: <1310078023-28958-4-git-send-email-lindner_marek@yahoo.de> X-Mailer: git-send-email 1.7.5.3 In-Reply-To: <1310078023-28958-1-git-send-email-lindner_marek@yahoo.de> References: <1310078023-28958-1-git-send-email-lindner_marek@yahoo.de> 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 3/4] batman-adv: keep global table consistency in case of roaming 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: Thu, 07 Jul 2011 22:34:08 -0000 From: Antonio Quartulli To keep consistency of other originator tables, new clients detected as roamed, are kept in the global table but are marked as TT_CLIENT_PENDING They are purged only when the new ttvn is received by the corresponding originator. Moreover they need to be considered as removed in case of global transtable lookup. Signed-off-by: Antonio Quartulli Signed-off-by: Marek Lindner --- net/batman-adv/translation-table.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index 7cc67c0..fb6931d 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c @@ -230,8 +230,9 @@ 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; - _tt_global_del(bat_priv, tt_global_entry, - "local tt received"); + /* The global entry has to be marked as PENDING and has to be + * kept for consistency purpose */ + tt_global_entry->flags |= TT_CLIENT_PENDING; send_roam_adv(bat_priv, tt_global_entry->addr, tt_global_entry->orig_node); } @@ -787,6 +788,11 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv, if (!atomic_inc_not_zero(&tt_global_entry->orig_node->refcount)) goto free_tt; + /* A global client marked as PENDING has already moved from that + * originator */ + if (tt_global_entry->flags & TT_CLIENT_PENDING) + goto free_tt; + orig_node = tt_global_entry->orig_node; free_tt: