From patchwork Thu Jul 7 12:24:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1231 Return-Path: Received: from confino.investici.org (investici.nine.ch [217.150.252.179]) by open-mesh.org (Postfix) with ESMTPS id C8EAE1542DF for ; Thu, 7 Jul 2011 14:25:27 +0200 (CEST) Authentication-Results: open-mesh.org; dkim=pass (1024-bit key) header.i=@autistici.org; dkim-adsp=pass Received: from [217.150.252.179] (confino [217.150.252.179]) (Authenticated sender: ordex@autistici.org) by localhost (Postfix) with ESMTPSA id AC32FC8648; Thu, 7 Jul 2011 12:25:26 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 confino.investici.org AC32FC8648 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1310041526; bh=W8YHubmd7gdcBotX8PcGCyvKkCrK/1HFkMJ8aJSm/io=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=hHe1lByR9W8yTebNCTBT9GG9HZYlXTCwiJz2I5p+KK53BbPthXarvgRjzThVJBQUT hpeKcQbVbf368ItDPwn61m18hojYt+hcPPQhsKeoku4CfukGngeCrV0tnttrgWhMaN ppmELAbwf8H6r6UmLGGotMpUAkeFS4MZTu+g73QM= From: Antonio Quartulli To: "B.A.T.M.A.N" Date: Thu, 7 Jul 2011 14:24:34 +0200 Message-Id: <1310041474-7624-1-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1310031027-7198-1-git-send-email-ordex@autistici.org> References: <1310031027-7198-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCHv2] 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 12:25:28 -0000 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 --- Comment rephrased. routing.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/routing.c b/routing.c index 2cb98be..130fa07 100644 --- a/routing.c +++ b/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 the a single value could repesent different states + * (due to the wrap around). Thus a node has to check whether + * the table resulting (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;