batman-adv: tvlv: handle negative tvlv processing return codes

batadv_tvlv_containers_process() was implemented with only two return codes
from the handlers in mind:

* NET_RX_SUCCESS (0)
* NET_RX_DROP (1)

The multicast handlers broke this convention and are also returning
negative return codes. But the processing code was never updated to
correctly aggregate them.

To handle negative return codes for non-OGM(2) handlers, they are now
aggregated to:

* NET_RX_SUCCESS when no handlers returned a different return code
* the last negative return code when at least one handler returned a
  negative return code
* NET_RX_DROP otherwise

With the current callers, the old implementation is not triggering any
unexpected behavior. The behavior is only adjusted for new code which might
need more reliable return values.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
This commit is contained in:
Sven Eckelmann 2026-07-30 10:57:53 +02:00
commit e558ee0088
No known key found for this signature in database
GPG key ID: 4D0F772BD314F5CB
2 changed files with 17 additions and 9 deletions