Skip to content

Commit

Permalink
batman-adv: request the full table if tt_crc doesn't match
Browse files Browse the repository at this point in the history
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 <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
  • Loading branch information
Antonio Quartulli authored and Marek Lindner committed Jul 7, 2011
1 parent 980d55b commit a7f9bec
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions net/batman-adv/routing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a7f9bec

Please sign in to comment.