Skip to content

Commit abd6360

Browse files
neocturnesimonwunderlich
authored andcommitted
batman-adv: fix packet checksum in receive path
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: c6c8fea ("net: Add batman-adv meshing protocol") 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 7928b2c commit abd6360

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

net/batman-adv/soft-interface.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -459,13 +459,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
459459

460460
/* skb->dev & skb->pkt_type are set here */
461461
skb->protocol = eth_type_trans(skb, soft_iface);
462-
463-
/* should not be necessary anymore as we use skb_pull_rcsum()
464-
* TODO: please verify this and remove this TODO
465-
* -- Dec 21st 2009, Simon Wunderlich
466-
*/
467-
468-
/* skb->ip_summed = CHECKSUM_UNNECESSARY; */
462+
skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
469463

470464
batadv_inc_counter(bat_priv, BATADV_CNT_RX);
471465
batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES,

0 commit comments

Comments
 (0)