[PATCH batadv v2 0/3] batman-adv: tp_meter: error reporting and role mixups

Sven Eckelmann <[email protected]>
Newsgroups org.open-mesh.lists.batman
Message-ID <[email protected]>
batadv_tp_sender_shutdown() previously used two separate variables to track
session state: sending (an atomic flag indicating whether the session was
active) and reason (a plain enum storing the stop reason). This introduced
a race window between the two writes: after sending was cleared to 0,
batadv_tp_send() could observe the stopped state and call
batadv_tp_sender_end() before reason was written, causing the wrong stop
reason to be reported to the caller.

The state + reason handling has to be reworked to only modify a single
variable

At the same, time we had some tp_vars role confusion and overly large
tp_vars for receiving. Just split them up. Making sure that the search
functions only search for the correct role and at the same time only use
the required memory.

The last patch should not enter stable/net.git but go through
main/net-next.git. It is just added here because it depends on the first
patch.

Signed-off-by: Sven Eckelmann <[email protected]>
---
Changes in v2:
- fix send_result kernel-doc
- rebase patch
- add patch to avoid role mixup in search functions
- add patch to split sender and receiver sessions
- Link to v1: https://patch.msgid.link/[email protected]

---
Sven Eckelmann (3):
      batman-adv: tp_meter: fix race condition in send error reporting
      batman-adv: tp_meter: avoid role confusion in tp_list
      batman-adv: tp_meter: split vars into sender and receiver types

 net/batman-adv/main.c     |   3 +-
 net/batman-adv/tp_meter.c | 453 +++++++++++++++++++++++++++-------------------
 net/batman-adv/types.h    | 109 +++++------
 3 files changed, 325 insertions(+), 240 deletions(-)
---
base-commit: ff182fc0c666754e3f35f7b63c9ccf0dff239e52
change-id: 20260513-tp-reason-missing-f1aa51f3f374

Best regards,
--  
Sven Eckelmann <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.