public inbox for b.a.t.m.a.n@lists.open-mesh.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH maint v2 1/2] batman-adv: fix packet checksum in receive path
@ 2018-01-23  9:59 Matthias Schiffer
  2018-01-23  9:59 ` [B.A.T.M.A.N.] [PATCH maint v2 2/2] batman-adv: invalidate checksum on fragment reassembly Matthias Schiffer
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Matthias Schiffer @ 2018-01-23  9:59 UTC (permalink / raw)
  To: b.a.t.m.a.n

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 nor occur on every
system using batman-adv. I could reproduce this issue by stacking
batman-adv on top of a VXLAN interface.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
---
 net/batman-adv/soft-interface.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 9f673cdf..6f7ce7a6 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -451,13 +451,7 @@ void batadv_interface_rx(struct net_device *soft_iface,
 
 	/* skb->dev & skb->pkt_type are set here */
 	skb->protocol = eth_type_trans(skb, soft_iface);
-
-	/* 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; */
+	skb_postpull_rcsum(skb, eth_hdr(skb), ETH_HLEN);
 
 	batadv_inc_counter(bat_priv, BATADV_CNT_RX);
 	batadv_add_counter(bat_priv, BATADV_CNT_RX_BYTES,
-- 
2.16.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-23 12:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23  9:59 [B.A.T.M.A.N.] [PATCH maint v2 1/2] batman-adv: fix packet checksum in receive path Matthias Schiffer
2018-01-23  9:59 ` [B.A.T.M.A.N.] [PATCH maint v2 2/2] batman-adv: invalidate checksum on fragment reassembly Matthias Schiffer
2018-01-23 11:46 ` [B.A.T.M.A.N.] [PATCH maint v2 1/2] batman-adv: fix packet checksum in receive path Linus Lüssing
2018-01-23 12:21 ` Sven Eckelmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox