b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH] batman-adv: request the full table if tt_crc doesn't match
@ 2011-07-07  9:30 Antonio Quartulli
  2011-07-07 12:24 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
  0 siblings, 1 reply; 3+ messages in thread
From: Antonio Quartulli @ 2011-07-07  9:30 UTC (permalink / raw)
  To: B.A.T.M.A.N

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(-)

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;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [B.A.T.M.A.N.] [PATCHv2] batman-adv: request the full table if tt_crc doesn't match
  2011-07-07  9:30 [B.A.T.M.A.N.] [PATCH] batman-adv: request the full table if tt_crc doesn't match Antonio Quartulli
@ 2011-07-07 12:24 ` Antonio Quartulli
  2011-07-07 12:38   ` Marek Lindner
  0 siblings, 1 reply; 3+ messages in thread
From: Antonio Quartulli @ 2011-07-07 12:24 UTC (permalink / raw)
  To: B.A.T.M.A.N

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>
---

Comment rephrased.

 routing.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/routing.c b/routing.c
index 2cb98be..130fa07 100644
--- a/routing.c
+++ b/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 the a single value could repesent different states
+		 * (due to the wrap around). Thus a node has to check whether
+		 * the table resulting (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;
-- 
1.7.3.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCHv2] batman-adv: request the full table if tt_crc doesn't match
  2011-07-07 12:24 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
@ 2011-07-07 12:38   ` Marek Lindner
  0 siblings, 0 replies; 3+ messages in thread
From: Marek Lindner @ 2011-07-07 12:38 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-07 12:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-07  9:30 [B.A.T.M.A.N.] [PATCH] batman-adv: request the full table if tt_crc doesn't match Antonio Quartulli
2011-07-07 12:24 ` [B.A.T.M.A.N.] [PATCHv2] " Antonio Quartulli
2011-07-07 12:38   ` Marek Lindner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).