]> git.ipfire.org Git - thirdparty/linux.git/commit
batman-adv: tp_meter: avoid role confusion in tp_list
authorSven Eckelmann <sven@narfation.org>
Sat, 16 May 2026 10:33:41 +0000 (12:33 +0200)
committerSven Eckelmann <sven@narfation.org>
Tue, 19 May 2026 06:24:30 +0000 (08:24 +0200)
commitff24f2ecfd94c07a2b89bac497433e3b23271cac
tree41451548199dc7de6555f83024fe09d9fb8f619e
parent71dce47f0758537fff78fddb5fb0d4632d29b29f
batman-adv: tp_meter: avoid role confusion in tp_list

Session lookups in tp_list matched only on destination address (and
optionally session ID), leaving role validation to the caller. If two
sessions with the same other_end coexisted (one as sender, one as receiver)
a lookup could silently return the wrong one, causing the caller's role to
bail out early, potentially skipping necessary cleanup.

Move the role check into the lookup functions themselves so the correct
entry is always returned, or none at all. Since batadv_tp_start()
legitimately needs to detect any active session to a destination regardless
of role, introduce a dedicated helper for that case rather than bending the
existing lookup semantics.

Cc: stable@kernel.org
Fixes: 33a3bb4a3345 ("batman-adv: throughput meter implementation")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/tp_meter.c