Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92f90f56 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Marek Lindner
Browse files

batman-adv: refactor tt_global_del() to avoid misalignment

parent 032b7969
Loading
Loading
Loading
Loading
+22 −20
Original line number Original line Diff line number Diff line
@@ -657,11 +657,12 @@ void tt_global_del(struct bat_priv *bat_priv,
	struct tt_local_entry *tt_local_entry = NULL;
	struct tt_local_entry *tt_local_entry = NULL;


	tt_global_entry = tt_global_hash_find(bat_priv, addr);
	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;
		goto out;


	if (tt_global_entry->orig_node == orig_node) {
	if (!roaming)
		if (roaming) {
		goto out_del;

	/* if we are deleting a global entry due to a roam
	/* if we are deleting a global entry due to a roam
	 * event, there are two possibilities:
	 * event, there are two possibilities:
	 * 1) the client roamed from node A to node B => we mark
	 * 1) the client roamed from node A to node B => we mark
@@ -677,9 +678,10 @@ void tt_global_del(struct bat_priv *bat_priv,
		tt_global_entry->roam_at = jiffies;
		tt_global_entry->roam_at = jiffies;
		goto out;
		goto out;
	}
	}
		}

out_del:
	_tt_global_del(bat_priv, tt_global_entry, message);
	_tt_global_del(bat_priv, tt_global_entry, message);
	}

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