diff options
author | Antonio Quartulli <ordex@autistici.org> | 2011-12-04 06:26:50 -0500 |
---|---|---|
committer | Marek Lindner <lindner_marek@yahoo.de> | 2011-12-06 14:12:55 -0500 |
commit | 03fc3070457dc0e6a717a2e732af93ef1cb2ae51 (patch) | |
tree | 103840f9e06192967bde51604ddf897f47c61ad6 /net | |
parent | 1ea6b8f48918282bdca0b32a34095504ee65bab5 (diff) |
batman-adv: in case of roaming mark the client with TT_CLIENT_ROAM
In case of a client roaming from node A to node B, the latter have to mark the
corresponding global entry with TT_CLIENT_ROAM (instead of TT_CLIENT_PENDING).
Marking a global entry with TT_CLIENT_PENDING will end up in keeping such entry
forever (because this flag is only meant to be used with local entries and it is
never checked on global ones).
In the worst case (all the clients roaming to the same node A) the local and the
global table will contain exactly the same clients. Batman-adv will continue to
work, but the memory usage is duplicated.
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/batman-adv/translation-table.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c index c7aafc7c5ed4..c46b1407c885 100644 --- a/net/batman-adv/translation-table.c +++ b/net/batman-adv/translation-table.c | |||
@@ -245,9 +245,11 @@ void tt_local_add(struct net_device *soft_iface, const uint8_t *addr, | |||
245 | if (tt_global_entry) { | 245 | if (tt_global_entry) { |
246 | /* This node is probably going to update its tt table */ | 246 | /* This node is probably going to update its tt table */ |
247 | tt_global_entry->orig_node->tt_poss_change = true; | 247 | tt_global_entry->orig_node->tt_poss_change = true; |
248 | /* The global entry has to be marked as PENDING and has to be | 248 | /* The global entry has to be marked as ROAMING and has to be |
249 | * kept for consistency purpose */ | 249 | * kept for consistency purpose */ |
250 | tt_global_entry->flags |= TT_CLIENT_PENDING; | 250 | tt_global_entry->flags |= TT_CLIENT_ROAM; |
251 | tt_global_entry->roam_at = jiffies; | ||
252 | |||
251 | send_roam_adv(bat_priv, tt_global_entry->addr, | 253 | send_roam_adv(bat_priv, tt_global_entry->addr, |
252 | tt_global_entry->orig_node); | 254 | tt_global_entry->orig_node); |
253 | } | 255 | } |