···245 if (tt_global_entry) {246 /* This node is probably going to update its tt table */247 tt_global_entry->orig_node->tt_poss_change = true;248- /* The global entry has to be marked as PENDING and has to be249 * kept for consistency purpose */250- tt_global_entry->flags |= TT_CLIENT_PENDING;00251 send_roam_adv(bat_priv, tt_global_entry->addr,252 tt_global_entry->orig_node);253 }···696 const char *message, bool roaming)697{698 struct tt_global_entry *tt_global_entry = NULL;0699700 tt_global_entry = tt_global_hash_find(bat_priv, addr);701 if (!tt_global_entry)···704705 if (tt_global_entry->orig_node == orig_node) {706 if (roaming) {707- tt_global_entry->flags |= TT_CLIENT_ROAM;708- tt_global_entry->roam_at = jiffies;709- goto out;000000000000710 }711 _tt_global_del(bat_priv, tt_global_entry, message);712 }713out:714 if (tt_global_entry)715 tt_global_entry_free_ref(tt_global_entry);00716}717718void tt_global_del_orig(struct bat_priv *bat_priv,
···245 if (tt_global_entry) {246 /* This node is probably going to update its tt table */247 tt_global_entry->orig_node->tt_poss_change = true;248+ /* The global entry has to be marked as ROAMING and has to be249 * kept for consistency purpose */250+ tt_global_entry->flags |= TT_CLIENT_ROAM;251+ tt_global_entry->roam_at = jiffies;252+253 send_roam_adv(bat_priv, tt_global_entry->addr,254 tt_global_entry->orig_node);255 }···694 const char *message, bool roaming)695{696 struct tt_global_entry *tt_global_entry = NULL;697+ struct tt_local_entry *tt_local_entry = NULL;698699 tt_global_entry = tt_global_hash_find(bat_priv, addr);700 if (!tt_global_entry)···701702 if (tt_global_entry->orig_node == orig_node) {703 if (roaming) {704+ /* if we are deleting a global entry due to a roam705+ * event, there are two possibilities:706+ * 1) the client roamed from node A to node B => we mark707+ * it with TT_CLIENT_ROAM, we start a timer and we708+ * wait for node B to claim it. In case of timeout709+ * the entry is purged.710+ * 2) the client roamed to us => we can directly delete711+ * the global entry, since it is useless now. */712+ tt_local_entry = tt_local_hash_find(bat_priv,713+ tt_global_entry->addr);714+ if (!tt_local_entry) {715+ tt_global_entry->flags |= TT_CLIENT_ROAM;716+ tt_global_entry->roam_at = jiffies;717+ goto out;718+ }719 }720 _tt_global_del(bat_priv, tt_global_entry, message);721 }722out:723 if (tt_global_entry)724 tt_global_entry_free_ref(tt_global_entry);725+ if (tt_local_entry)726+ tt_local_entry_free_ref(tt_local_entry);727}728729void tt_global_del_orig(struct bat_priv *bat_priv,