Commit abd63605 authored by Matthias Schiffer's avatar Matthias Schiffer Committed by Simon Wunderlich

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: c6c8fea2 ("net: Add batman-adv meshing protocol")
Tested-by: default avatarMaximilian Wilhelm <max@sdn.clinic>
Signed-off-by: default avatarMatthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
Signed-off-by: default avatarSimon Wunderlich <sw@simonwunderlich.de>
parent 7928b2cb
...@@ -459,13 +459,7 @@ void batadv_interface_rx(struct net_device *soft_iface, ...@@ -459,13 +459,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
/* skb->dev & skb->pkt_type are set here */ /* skb->dev & skb->pkt_type are set here */
skb->protocol = eth_type_trans(skb, soft_iface); skb->protocol = eth_type_trans(skb, soft_iface);
skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
/* should not be necessary anymore as we use skb_pull_rcsum()
* TODO: please verify this and remove this TODO
* -- Dec 21st 2009, Simon Wunderlich
*/
/* skb->ip_summed = CHECKSUM_UNNECESSARY; */
batadv_inc_counter(bat_priv, BATADV_CNT_RX); batadv_inc_counter(bat_priv, BATADV_CNT_RX);
batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES, batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment