[PATCH batadv 0/2] batman-adv: tvlv: avoid race of cifsnotfound handler state

Sven Eckelmann <[email protected]> Sun, 14 Jun 2026 12:30:39 +0200
Newsgroups org.open-mesh.lists.batman
Message-ID <[email protected]>
TVLV handlers can have the flag BATADV_TVLV_HANDLER_OGM_CIFNOTFND set to
signal that the OGM handler should be called (with NULL for data) when the
specific TVLV container was not found in the OGM. This is used by:

* DAT
* GW
* Multicast (OGM + Tracker)

The state whether the handler was executed was stored in the struct
batadv_tvlv_handler. But the TVLV processing is started without any lock.
Multiple parallel contexts processing TVLVs would therefore overwrite each
others BATADV_TVLV_HANDLER_OGM_CALLED flag in the shared
batadv_tvlv_handler.

Drop the shared BATADV_TVLV_HANDLER_OGM_CALLED flag and instead determine,
per TVLV buffer, whether a matching container was present by scanning the
packet's buffer.

Signed-off-by: Sven Eckelmann <[email protected]>
---
Sven Eckelmann (2):
      batman-adv: tvlv: avoid race of cifsnotfound handler state
      batman-adv: tvlv: extract tvlv header iterator

 net/batman-adv/tvlv.c  | 111 +++++++++++++++++++++++++++++++++++++++----------
 net/batman-adv/types.h |   7 ----
 2 files changed, 89 insertions(+), 29 deletions(-)
---
base-commit: a084a40e7529be89a94f843e8927e543df90a344
change-id: 20260614-tvlv-non-const-flags-735c1cddcf01

Best regards,
--  
Sven Eckelmann <[email protected]>