summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/routing.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-07-08 08:44:57 -0700
committerDavid S. Miller <davem@davemloft.net>2011-07-08 08:44:57 -0700
commit3f9aed7c7d517dbc717a97649d0a5a9dc80bf4f2 (patch)
treebed215245dc32aea477c76f7124e6af13ba362ac /net/batman-adv/routing.c
parent31817df025e24559a01d33ddd68bd11b21bf9d7b (diff)
parenta7f9becb7d27008af0f72f8449c110276b0df37d (diff)
downloadblackbird-op-linux-3f9aed7c7d517dbc717a97649d0a5a9dc80bf4f2.tar.gz
blackbird-op-linux-3f9aed7c7d517dbc717a97649d0a5a9dc80bf4f2.zip
Merge branch 'batman-adv/next' of git://git.open-mesh.org/linux-merge
Diffstat (limited to 'net/batman-adv/routing.c')
-rw-r--r--net/batman-adv/routing.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 2cb98bed1586..0f32c818874d 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;
OpenPOWER on IntegriCloud