aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv')
-rw-r--r--net/batman-adv/translation-table.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index ff9a1b33c136..30c2d1b7de49 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -657,29 +657,31 @@ void tt_global_del(struct bat_priv *bat_priv,
657 struct tt_local_entry *tt_local_entry = NULL; 657 struct tt_local_entry *tt_local_entry = NULL;
658 658
659 tt_global_entry = tt_global_hash_find(bat_priv, addr); 659 tt_global_entry = tt_global_hash_find(bat_priv, addr);
660 if (!tt_global_entry) 660 if (!tt_global_entry || tt_global_entry->orig_node != orig_node)
661 goto out; 661 goto out;
662 662
663 if (tt_global_entry->orig_node == orig_node) { 663 if (!roaming)
664 if (roaming) { 664 goto out_del;
665 /* if we are deleting a global entry due to a roam 665
666 * event, there are two possibilities: 666 /* if we are deleting a global entry due to a roam
667 * 1) the client roamed from node A to node B => we mark 667 * event, there are two possibilities:
668 * it with TT_CLIENT_ROAM, we start a timer and we 668 * 1) the client roamed from node A to node B => we mark
669 * wait for node B to claim it. In case of timeout 669 * it with TT_CLIENT_ROAM, we start a timer and we
670 * the entry is purged. 670 * wait for node B to claim it. In case of timeout
671 * 2) the client roamed to us => we can directly delete 671 * the entry is purged.
672 * the global entry, since it is useless now. */ 672 * 2) the client roamed to us => we can directly delete
673 tt_local_entry = tt_local_hash_find(bat_priv, 673 * the global entry, since it is useless now. */
674 tt_global_entry->common.addr); 674 tt_local_entry = tt_local_hash_find(bat_priv,
675 if (!tt_local_entry) { 675 tt_global_entry->common.addr);
676 tt_global_entry->common.flags |= TT_CLIENT_ROAM; 676 if (!tt_local_entry) {
677 tt_global_entry->roam_at = jiffies; 677 tt_global_entry->common.flags |= TT_CLIENT_ROAM;
678 goto out; 678 tt_global_entry->roam_at = jiffies;
679 } 679 goto out;
680 }
681 _tt_global_del(bat_priv, tt_global_entry, message);
682 } 680 }
681
682out_del:
683 _tt_global_del(bat_priv, tt_global_entry, message);
684
683out: 685out:
684 if (tt_global_entry) 686 if (tt_global_entry)
685 tt_global_entry_free_ref(tt_global_entry); 687 tt_global_entry_free_ref(tt_global_entry);