batman-adv: fix packet checksum in receive path
authorMatthias Schiffer <mschiffer@universe-factory.net>
Tue, 23 Jan 2018 09:59:49 +0000 (10:59 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 31 May 2018 23:30:18 +0000 (00:30 +0100)
commit73bcecff7ee24a33241aeb60cd8de94330b45abd
treeddfc4b1ddff69a1fdac18f61e1b30d69d28b67c9
parent6acc5b4ab4c8d5a4373d733cc384a1aef17084ff
batman-adv: fix packet checksum in receive path

commit abd6360591d3f8259f41c34e31ac4826dfe621b8 upstream.

eth_type_trans() internally calls skb_pull(), which does not adjust the
skb checksum; skb_postpull_rcsum() is necessary to avoid log spam of the
form "bat0: hw csum failure" when packets with CHECKSUM_COMPLETE are
received.

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: c6c8fea29769 ("net: Add batman-adv meshing protocol")
Tested-by: Maximilian Wilhelm <max@sdn.clinic>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/batman-adv/soft-interface.c