batman-adv: request the full table if tt_crc doesn't match

Message ID 1310031027-7198-1-git-send-email-ordex@autistici.org
State Superseded, archived
Headers

Commit Message

Antonio Quartulli July 7, 2011, 9:30 a.m. UTC
  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>
---
 routing.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
  

Comments

Marek Lindner July 7, 2011, 12:38 p.m. UTC | #1
On Thursday, July 07, 2011 14:24:34 Antonio Quartulli wrote:
> In case of tt_crc mismatching for a certain orig_node after applying the
> changes, the node must request the full table immediately.

Applied in revision 33184a1.

Thanks,
Marek
  

Patch

diff --git a/routing.c b/routing.c
index 2cb98be..010ebb7 100644
--- a/routing.c
+++ b/routing.c
@@ -91,6 +91,11 @@  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);
+
+		/* If something went wrong we must request the full table now */
+		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;