]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
batman-adv: fix (m|b)cast csum after decrementing TTL
authorSven Eckelmann <sven@narfation.org>
Wed, 10 Jun 2026 07:52:22 +0000 (09:52 +0200)
committerSven Eckelmann <sven@narfation.org>
Sat, 13 Jun 2026 05:51:17 +0000 (07:51 +0200)
commite728bbdf32660c8f32b8f5e8d09427a2c131ad60
treec9bb04c26bac35b9fed97289a09162419a7f1411
parent4cd6d3a4b96a8576f1fed8f9f9f17c2dc2978e0c
batman-adv: fix (m|b)cast csum after decrementing TTL

The broadcast and multicast packets can be received at the same time by the
local system and forwarded to other nodes. Both are simply decrementing the
TTL at the beginning of the receive path - independent of chosen paths
(receive/forward). But such a modification of the data conflicts with the
hw csum. This is not a problem when the packet is directly forwarded but
can cause errors in the local receive path.

Such a problem can then trigger a "hw csum failure". The receiver path must
therefore ensure that the csum is fixed for each modification of the
payload before batadv_interface_rx() is reached.

Since all batman-adv packet types with a ttl have it as u8 at offset 2, a
helper can be used for all of them. But it is only used at the moment for
batadv_bcast_packet and batadv_mcast_packet because they are the only ones
which deliver the packet locally but unconditionally modify the TTL.

Cc: stable@kernel.org
Fixes: 3f69339068f9 ("batman-adv: bcast: queue per interface, if needed")
Fixes: 07afe1ba288c ("batman-adv: mcast: implement multicast packet reception and forwarding")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
net/batman-adv/routing.c