summaryrefslogtreecommitdiff
path: root/include/linux/timerqueue.h
diff options
context:
space:
mode:
authorSven Eckelmann <sven@narfation.org>2026-05-09 18:33:16 +0200
committerSven Eckelmann <sven@narfation.org>2026-06-03 08:02:21 +0200
commitfeb4a390a540eec60a2c39f7b893f19fdf57b3a5 (patch)
treefe80d439a362d32d0f998e5277e321109c7e27dc /include/linux/timerqueue.h
parent15ccbf685222274f5add1387af58c2a41a95f81e (diff)
batman-adv: tp_meter: split vars into sender and receiver types
The monolithic batadv_tp_vars struct holds fields for both sender and receiver roles, distinguished only by a runtime enum role. This makes it easy to accidentally access a field intended for the opposite role, since neither the compiler nor the type system provide any guard against such mistakes. The role check also adds unnecessary branching in several code paths. Introduce batadv_tp_vars_common to hold fields shared across both roles, then derive two separate types (sender/receiver) from it. The functions can operate on them without any ambiguity about the available fields. This also reduces the memory footprint of receiver sessions, which no longer carry the substantial sender-only fields. Care must be taken to prevent concurrent TP sessions between the same two peers in opposite directions, since sender and receiver sessions are now tracked in separate lists and a lookup in one list no longer detects a session in the other. Signed-off-by: Sven Eckelmann <sven@narfation.org>
Diffstat (limited to 'include/linux/timerqueue.h')
0 files changed, 0 insertions, 0 deletions