From 49a04fb70986941c5edb3923c805fe29ede04050 Mon Sep 17 00:00:00 2001 From: Antonio Quartulli Date: Thu, 7 Jul 2011 14:24:34 +0200 Subject: [PATCH] --- yaml --- r: 256159 b: refs/heads/master c: a7f9becb7d27008af0f72f8449c110276b0df37d h: refs/heads/master i: 256157: afaec937c56226d07c212a3f00d0dab0504b3227 256155: b160a9eeed2a5b1f5b5169035ea7b7cc53f7a392 256151: 9c3e4ad1ab26707cf462e6ceae739ec4b5f2fb9d 256143: 5156b8a2cb3c82088f2328d3efc97dbd34cd7cd8 256127: 1707a0614a5d9fae2b09a765d0e33bbe7d3aee1f v: v3 --- [refs] | 2 +- trunk/net/batman-adv/routing.c | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index c43fd810d2ee..59ed115190fb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 980d55b20a730cbabc74cdc57be9c47713dba57b +refs/heads/master: a7f9becb7d27008af0f72f8449c110276b0df37d diff --git a/trunk/net/batman-adv/routing.c b/trunk/net/batman-adv/routing.c index 2cb98bed1586..0f32c818874d 100644 --- a/trunk/net/batman-adv/routing.c +++ b/trunk/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;