From: Antonio Quartulli Date: Thu, 7 Jul 2011 12:24:34 +0000 (+0200) Subject: batman-adv: request the full table if tt_crc doesn't match X-Git-Tag: firefly_0821_release~3680^2~5008^2~199^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a7f9becb7d27008af0f72f8449c110276b0df37d;p=firefly-linux-kernel-4.4.55.git batman-adv: request the full table if tt_crc doesn't match 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 --- 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;