Skip to content

Commit

Permalink
batman-adv: keep global table consistency in case of roaming
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Antonio Quartulli authored and Marek Lindner committed Jul 7, 2011
1 parent 058d0e2 commit 980d55b
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 980d55b

Please sign in to comment.