The following commit has been merged in the master branch:
commit 3f9aed7c7d517dbc717a97649d0a5a9dc80bf4f2
Merge: 31817df025e24559a01d33ddd68bd11b21bf9d7b a7f9becb7d27008af0f72f8449c110276b0df37d
Author: David S. Miller <davem(a)davemloft.net>
Date: Fri Jul 8 08:44:57 2011 -0700
Merge branch 'batman-adv/next' of git://git.open-mesh.org/linux-merge
--
LinuxNextTracking
The following commit has been merged in the master branch:
commit a7f9becb7d27008af0f72f8449c110276b0df37d
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Thu Jul 7 14:24:34 2011 +0200
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 <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/net/batman-adv/routing.c b/net/batman-adv/routing.c
index 2cb98be..0f32c81 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;
--
LinuxNextTracking
The following commit has been merged in the master branch:
commit 980d55b20a730cbabc74cdc57be9c47713dba57b
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Thu Jul 7 01:40:59 2011 +0200
batman-adv: keep global table consistency in case of roaming
To keep consistency of other originator tables, new clients detected as
roamed, are kept in the global table but are marked as TT_CLIENT_PENDING
They are purged only when the new ttvn is received by the corresponding
originator. Moreover they need to be considered as removed in case of global
transtable lookup.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 7cc67c0..fb6931d 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -230,8 +230,9 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr)
if (tt_global_entry) {
/* This node is probably going to update its tt table */
tt_global_entry->orig_node->tt_poss_change = true;
- _tt_global_del(bat_priv, tt_global_entry,
- "local tt received");
+ /* The global entry has to be marked as PENDING and has to be
+ * kept for consistency purpose */
+ tt_global_entry->flags |= TT_CLIENT_PENDING;
send_roam_adv(bat_priv, tt_global_entry->addr,
tt_global_entry->orig_node);
}
@@ -787,6 +788,11 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv,
if (!atomic_inc_not_zero(&tt_global_entry->orig_node->refcount))
goto free_tt;
+ /* A global client marked as PENDING has already moved from that
+ * originator */
+ if (tt_global_entry->flags & TT_CLIENT_PENDING)
+ goto free_tt;
+
orig_node = tt_global_entry->orig_node;
free_tt:
--
LinuxNextTracking
The following commit has been merged in the master branch:
commit c8c991bf2076d711f14ff9063db306fd522ddcd4
Author: Antonio Quartulli <ordex(a)autistici.org>
Date: Thu Jul 7 01:40:57 2011 +0200
batman-adv: initialise last_ttvn and tt_crc for the orig_node structure
The last_ttvn and tt_crc fields of the orig_node structure were not
initialised causing an immediate TT_REQ/RES dialogue even if not needed.
Signed-off-by: Antonio Quartulli <ordex(a)autistici.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 4cc94d4..f3c3f62 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -223,6 +223,8 @@ struct orig_node *get_orig_node(struct bat_priv *bat_priv, const uint8_t *addr)
orig_node->bat_priv = bat_priv;
memcpy(orig_node->orig, addr, ETH_ALEN);
orig_node->router = NULL;
+ orig_node->tt_crc = 0;
+ atomic_set(&orig_node->last_ttvn, 0);
orig_node->tt_buff = NULL;
orig_node->tt_buff_len = 0;
atomic_set(&orig_node->tt_size, 0);
--
LinuxNextTracking