Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 290489
b: refs/heads/master
c: 92f90f5
h: refs/heads/master
i:
  290487: a1ad3fb
v: v3
  • Loading branch information
Sven Eckelmann authored and Marek Lindner committed Feb 16, 2012
1 parent e0853c1 commit e86a66a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 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: 032b7969f8874d5ddc65691cd3d008beffd2a09e
refs/heads/master: 92f90f56caa30dfcb6c5755776d73df23ef2ae1a
42 changes: 22 additions & 20 deletions trunk/net/batman-adv/translation-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,29 +657,31 @@ void tt_global_del(struct bat_priv *bat_priv,
struct tt_local_entry *tt_local_entry = NULL;

tt_global_entry = tt_global_hash_find(bat_priv, addr);
if (!tt_global_entry)
if (!tt_global_entry || tt_global_entry->orig_node != orig_node)
goto out;

if (tt_global_entry->orig_node == orig_node) {
if (roaming) {
/* 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->common.addr);
if (!tt_local_entry) {
tt_global_entry->common.flags |= TT_CLIENT_ROAM;
tt_global_entry->roam_at = jiffies;
goto out;
}
}
_tt_global_del(bat_priv, tt_global_entry, message);
if (!roaming)
goto out_del;

/* 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->common.addr);
if (!tt_local_entry) {
tt_global_entry->common.flags |= TT_CLIENT_ROAM;
tt_global_entry->roam_at = jiffies;
goto out;
}

out_del:
_tt_global_del(bat_priv, tt_global_entry, message);

out:
if (tt_global_entry)
tt_global_entry_free_ref(tt_global_entry);
Expand Down

0 comments on commit e86a66a

Please sign in to comment.