Skip to content

Commit 3bf2a09

Browse files
neocturnesimonwunderlich
authored andcommitted
batman-adv: invalidate checksum on fragment reassembly
A more sophisticated implementation could try to combine fragment checksums when all fragments have CHECKSUM_COMPLETE and are split at even offsets. For now, we just set ip_summed to CHECKSUM_NONE to avoid "hw csum failure" warnings in the kernel log when fragmented frames are received. In consequence, skb_pull_rcsum() can be replaced with skb_pull(). Note that in usual setups, packets don't reach batman-adv with CHECKSUM_COMPLETE (I assume NICs bail out of checksumming when they see batadv's ethtype?), which is why the log messages do not occur on every system using batman-adv. I could reproduce this issue by stacking batman-adv on top of a VXLAN interface. Fixes: 610bfc6 ("batman-adv: Receive fragmented packets and merge") Tested-by: Maximilian Wilhelm <[email protected]> Signed-off-by: Matthias Schiffer <[email protected]> Signed-off-by: Sven Eckelmann <[email protected]> Signed-off-by: Simon Wunderlich <[email protected]>
1 parent abd6360 commit 3bf2a09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/batman-adv/fragmentation.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ batadv_frag_merge_packets(struct hlist_head *chain)
288288
/* Move the existing MAC header to just before the payload. (Override
289289
* the fragment header.)
290290
*/
291-
skb_pull_rcsum(skb_out, hdr_size);
291+
skb_pull(skb_out, hdr_size);
292+
skb_out->ip_summed = CHECKSUM_NONE;
292293
memmove(skb_out->data - ETH_HLEN, skb_mac_header(skb_out), ETH_HLEN);
293294
skb_set_mac_header(skb_out, -ETH_HLEN);
294295
skb_reset_network_header(skb_out);

0 commit comments

Comments
 (0)