From patchwork Thu Jul 7 22:35:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Lindner X-Patchwork-Id: 1217 Return-Path: Received: from nm1.bullet.mail.ukl.yahoo.com (nm1.bullet.mail.ukl.yahoo.com [217.146.183.218]) by open-mesh.org (Postfix) with SMTP id 7F1361542DF for ; Fri, 8 Jul 2011 00:36:00 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@yahoo.de; dkim-adsp=none Received: from [217.146.183.181] by nm1.bullet.mail.ukl.yahoo.com with NNFMP; 07 Jul 2011 22:36:00 -0000 Received: from [217.146.183.175] by tm12.bullet.mail.ukl.yahoo.com with NNFMP; 07 Jul 2011 22:35:59 -0000 Received: from [127.0.0.1] by omp1016.mail.ukl.yahoo.com with NNFMP; 07 Jul 2011 22:35:59 -0000 X-Yahoo-Newman-Id: 984637.45467.bm@omp1016.mail.ukl.yahoo.com Received: (qmail 34822 invoked from network); 7 Jul 2011 22:35:59 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.de; h=DKIM-Signature: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=bBDJ26CDSRu9/KexrjsmmYvsUemo4rP3L1aOxOZlyAFXoETltgCxDfXIRGy9BTNkcPxm9goMLR/fc0X8J02e0NQiEA1Yh/MYhswmlrRHr1kERAJXpXb1pousTtmgG/uAYng7DNYRqG78SPDIJ+HtX65bytiFjpOkQF/BZyYleGM= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.de; s=s1024; t=1310078159; bh=cw3skC7Ew66Iy2MemchC3FggSQO7hv61FpgbP3Dqpgk=; h=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=wO0BBXVetaL7jRcghKugTRHsS1M0d2aAHbJH6HtBHobwdp2Rl2jz9fZlQMDkwOphJWiRH3P2QWN+3dFw8xtQ/SDlLKTQ61OJoSUUR1rWB92IpzfohQDDqFd+5gB2DlN5gjJR8NIua8di0b7FODxM26H8vNtJ9MPjWAPLsqPXYwk= Received: from localhost (lindner_marek@90.61.212.109 with plain) by smtp129.mail.ukl.yahoo.com with SMTP; 07 Jul 2011 22:35:59 +0000 GMT X-Yahoo-SMTP: tW.h3tiswBBMXO2coYcbPigGD5Lt6zY_.Zc- X-YMail-OSG: QqZn_c0VM1miT56.XZQpVvTdCWtTo4LPopFTLoGTLTgsK_k cW..SuUZBYLUgaGPomJT5MA3nPoU4I6EpHVR3KO7JyeEZ1L8ABDPYJDqvekq cOj3pmpb0djzVw5zE1duBKCj0XEqyFEtQCW6cXINKwfnvgTI3n5HddNisOgE u7Y_RIsQeEoYSOhiLZU_D21LIwF0D64SKuJ1SeYJobGznbLfbdK_85Z.wUJk eALDRbpK7igf953D2frO41wiORid8RHSWE8KzXM8u2j25VxhZH1mGuMG6IZ6 ChV.RTDzWwkKbTmAWMUaqKueJD3_meYjU31NW9LfWs68WjET4RnJFsH66zVZ 1 X-Yahoo-Newman-Property: ymail-3 From: Marek Lindner To: davem@davemloft.net Date: Fri, 8 Jul 2011 00:35:46 +0200 Message-Id: <1310078146-29537-1-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 4/4] batman-adv: request the full table if tt_crc doesn't match 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:36:00 -0000 From: Antonio Quartulli In case of tt_crc mismatching for a certain orig_node after applying the changes, the node must request the full table immediately. Signed-off-by: Antonio Quartulli Signed-off-by: Marek Lindner --- net/batman-adv/routing.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c index 2cb98be..0f32c81 100644 --- a/net/batman-adv/routing.c +++ b/net/batman-adv/routing.c @@ -91,6 +91,18 @@ static void update_transtable(struct bat_priv *bat_priv, * to recompute it to spot any possible inconsistency * in the global table */ orig_node->tt_crc = tt_global_crc(bat_priv, orig_node); + + /* The ttvn alone is not enough to guarantee consistency + * because a single value could repesent different states + * (due to the wrap around). Thus a node has to check whether + * the resulting table (after applying the changes) is still + * consistent or not. E.g. a node could disconnect while its + * ttvn is X and reconnect on ttvn = X + TTVN_MAX: in this case + * checking the CRC value is mandatory to detect the + * inconsistency */ + if (orig_node->tt_crc != tt_crc) + goto request_table; + /* Roaming phase is over: tables are in sync again. I can * unset the flag */ orig_node->tt_poss_change = false;