batman-adv: Refresh patches
[feed/routing.git] / batman-adv / patches / 0025-batman-adv-invalidate-checksum-on-fragment-reassembl.patch
1 From: Matthias Schiffer <mschiffer@universe-factory.net>
2 Date: Tue, 23 Jan 2018 10:59:50 +0100
3 Subject: batman-adv: invalidate checksum on fragment reassembly
4
5 A more sophisticated implementation could try to combine fragment checksums
6 when all fragments have CHECKSUM_COMPLETE and are split at even offsets.
7 For now, we just set ip_summed to CHECKSUM_NONE to avoid "hw csum failure"
8 warnings in the kernel log when fragmented frames are received. In
9 consequence, skb_pull_rcsum() can be replaced with skb_pull().
10
11 Note that in usual setups, packets don't reach batman-adv with
12 CHECKSUM_COMPLETE (I assume NICs bail out of checksumming when they see
13 batadv's ethtype?), which is why the log messages do not occur on every
14 system using batman-adv. I could reproduce this issue by stacking
15 batman-adv on top of a VXLAN interface.
16
17 Fixes: 9b3eab61754d ("batman-adv: Receive fragmented packets and merge")
18 Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
19 Signed-off-by: Sven Eckelmann <sven@narfation.org>
20
21 Origin: upstream, https://git.open-mesh.org/batman-adv.git/commit/2c1bce065baa688bc1eca4116f83ca3b790432a5
22
23 diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
24 index 28f54887c975905d03372ab8ba5274fd82117651..5969d3705ec08a96438ecce06577d35291600753 100644
25 --- a/net/batman-adv/fragmentation.c
26 +++ b/net/batman-adv/fragmentation.c
27 @@ -287,7 +287,8 @@ batadv_frag_merge_packets(struct hlist_head *chain)
28 /* Move the existing MAC header to just before the payload. (Override
29 * the fragment header.)
30 */
31 - skb_pull_rcsum(skb_out, hdr_size);
32 + skb_pull(skb_out, hdr_size);
33 + skb_out->ip_summed = CHECKSUM_NONE;
34 memmove(skb_out->data - ETH_HLEN, skb_mac_header(skb_out), ETH_HLEN);
35 skb_set_mac_header(skb_out, -ETH_HLEN);
36 skb_reset_network_header(skb_out);