Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276766
b: refs/heads/master
c: 797399b
h: refs/heads/master
v: v3
  • Loading branch information
Antonio Quartulli authored and Marek Lindner committed Dec 6, 2011
1 parent cd55bb8 commit fa358ec
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03fc3070457dc0e6a717a2e732af93ef1cb2ae51
refs/heads/master: 797399b415b78dacdbcaffdb89e46e369ec88b98
21 changes: 18 additions & 3 deletions trunk/net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -696,22 +696,37 @@ void tt_global_del(struct bat_priv *bat_priv,
const char *message, bool roaming)
{
struct tt_global_entry *tt_global_entry = NULL;
struct tt_local_entry *tt_local_entry = NULL;

tt_global_entry = tt_global_hash_find(bat_priv, addr);
if (!tt_global_entry)
goto out;

if (tt_global_entry->orig_node == orig_node) {
if (roaming) {
tt_global_entry->flags |= TT_CLIENT_ROAM;
tt_global_entry->roam_at = jiffies;
goto out;
/* if we are deleting a global entry due to a roam
* event, there are two possibilities:
* 1) the client roamed from node A to node B => we mark
* it with TT_CLIENT_ROAM, we start a timer and we
* wait for node B to claim it. In case of timeout
* the entry is purged.
* 2) the client roamed to us => we can directly delete
* the global entry, since it is useless now. */
tt_local_entry = tt_local_hash_find(bat_priv,
tt_global_entry->addr);
if (!tt_local_entry) {
tt_global_entry->flags |= TT_CLIENT_ROAM;
tt_global_entry->roam_at = jiffies;
goto out;
}
}
_tt_global_del(bat_priv, tt_global_entry, message);
}
out:
if (tt_global_entry)
tt_global_entry_free_ref(tt_global_entry);
if (tt_local_entry)
tt_local_entry_free_ref(tt_local_entry);
}

void tt_global_del_orig(struct bat_priv *bat_priv,
Expand Down

0 comments on commit fa358ec

Please sign in to comment.