···245245 if (tt_global_entry) {246246 /* This node is probably going to update its tt table */247247 tt_global_entry->orig_node->tt_poss_change = true;248248- /* The global entry has to be marked as PENDING and has to be248248+ /* The global entry has to be marked as ROAMING and has to be249249 * kept for consistency purpose */250250- tt_global_entry->flags |= TT_CLIENT_PENDING;250250+ tt_global_entry->flags |= TT_CLIENT_ROAM;251251+ tt_global_entry->roam_at = jiffies;252252+251253 send_roam_adv(bat_priv, tt_global_entry->addr,252254 tt_global_entry->orig_node);253255 }···696694 const char *message, bool roaming)697695{698696 struct tt_global_entry *tt_global_entry = NULL;697697+ struct tt_local_entry *tt_local_entry = NULL;699698700699 tt_global_entry = tt_global_hash_find(bat_priv, addr);701700 if (!tt_global_entry)···704701705702 if (tt_global_entry->orig_node == orig_node) {706703 if (roaming) {707707- tt_global_entry->flags |= TT_CLIENT_ROAM;708708- tt_global_entry->roam_at = jiffies;709709- goto out;704704+ /* if we are deleting a global entry due to a roam705705+ * event, there are two possibilities:706706+ * 1) the client roamed from node A to node B => we mark707707+ * it with TT_CLIENT_ROAM, we start a timer and we708708+ * wait for node B to claim it. In case of timeout709709+ * the entry is purged.710710+ * 2) the client roamed to us => we can directly delete711711+ * the global entry, since it is useless now. */712712+ tt_local_entry = tt_local_hash_find(bat_priv,713713+ tt_global_entry->addr);714714+ if (!tt_local_entry) {715715+ tt_global_entry->flags |= TT_CLIENT_ROAM;716716+ tt_global_entry->roam_at = jiffies;717717+ goto out;718718+ }710719 }711720 _tt_global_del(bat_priv, tt_global_entry, message);712721 }713722out:714723 if (tt_global_entry)715724 tt_global_entry_free_ref(tt_global_entry);725725+ if (tt_local_entry)726726+ tt_local_entry_free_ref(tt_local_entry);716727}717728718729void tt_global_del_orig(struct bat_priv *bat_priv,