aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2011-07-06 19:40:59 -0400
committerMarek Lindner <lindner_marek@yahoo.de>2011-07-07 12:49:26 -0400
commit980d55b20a730cbabc74cdc57be9c47713dba57b (patch)
tree6b3d66dfe0134cea1b24114e2454ff3fa631a66a /net
parent058d0e26989e3da2fa031f551235f6ff1e0bc27c (diff)
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@autistici.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net')
-rw-r--r--net/batman-adv/translation-table.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 7cc67c0f4915..fb6931d00cd7 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)
230 if (tt_global_entry) { 230 if (tt_global_entry) {
231 /* This node is probably going to update its tt table */ 231 /* This node is probably going to update its tt table */
232 tt_global_entry->orig_node->tt_poss_change = true; 232 tt_global_entry->orig_node->tt_poss_change = true;
233 _tt_global_del(bat_priv, tt_global_entry, 233 /* The global entry has to be marked as PENDING and has to be
234 "local tt received"); 234 * kept for consistency purpose */
235 tt_global_entry->flags |= TT_CLIENT_PENDING;
235 send_roam_adv(bat_priv, tt_global_entry->addr, 236 send_roam_adv(bat_priv, tt_global_entry->addr,
236 tt_global_entry->orig_node); 237 tt_global_entry->orig_node);
237 } 238 }
@@ -787,6 +788,11 @@ struct orig_node *transtable_search(struct bat_priv *bat_priv,
787 if (!atomic_inc_not_zero(&tt_global_entry->orig_node->refcount)) 788 if (!atomic_inc_not_zero(&tt_global_entry->orig_node->refcount))
788 goto free_tt; 789 goto free_tt;
789 790
791 /* A global client marked as PENDING has already moved from that
792 * originator */
793 if (tt_global_entry->flags & TT_CLIENT_PENDING)
794 goto free_tt;
795
790 orig_node = tt_global_entry->orig_node; 796 orig_node = tt_global_entry->orig_node;
791 797
792free_tt: 798free_tt: