From patchwork Thu Jul 7 13:25:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antonio Quartulli X-Patchwork-Id: 1205 Return-Path: Received: from confino.investici.org (investici.nine.ch [217.150.252.179]) by open-mesh.org (Postfix) with ESMTPS id 1062415446C for ; Thu, 7 Jul 2011 15:25:54 +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 6A1C7C8661; Thu, 7 Jul 2011 13:25:53 +0000 (UTC) X-DKIM: Sendmail DKIM Filter v2.8.2 confino.investici.org 6A1C7C8661 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org; s=stigmate; t=1310045153; bh=L2xcvJFcGWtE3XmdMIXWwrmUa1f2DmsyazR8LBlg/NI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=fxBWfHNcTX62LCPwjDqZghdZaNW9LjCFxT1APNE/OgXve+m7RSwA9jMK33JnwawNa hoeQ4zbzqaFVMkDNvdyTVhZVZvjDVQUWVx9lTSx/PnnzZ1JoYoJ5gQ8EU/p6PV9MrX BcC/aMRNgiDOIVuTVoTyB4r8LkfNDiRnsza8Y/vU= From: Antonio Quartulli To: "B.A.T.M.A.N" Date: Thu, 7 Jul 2011 15:25:06 +0200 Message-Id: <1310045106-23202-5-git-send-email-ordex@autistici.org> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1310045106-23202-1-git-send-email-ordex@autistici.org> References: <1310045106-23202-1-git-send-email-ordex@autistici.org> Subject: [B.A.T.M.A.N.] [PATCHv4 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 13:25:54 -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 --- routing.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/routing.c b/routing.c index 2cb98be..0f32c81 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 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;