b.a.t.m.a.n.lists.open-mesh.org archive mirror
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,
	Matthias Schiffer <mschiffer@universe-factory.net>,
	Sven Eckelmann <sven@narfation.org>,
	Simon Wunderlich <sw@simonwunderlich.de>
Subject: [B.A.T.M.A.N.] [PATCH 2/7] batman-adv: invalidate checksum on fragment reassembly
Date: Fri,  2 Mar 2018 18:51:37 +0100	[thread overview]
Message-ID: <20180302175142.11838-3-sw@simonwunderlich.de> (raw)
In-Reply-To: <20180302175142.11838-1-sw@simonwunderlich.de>

From: Matthias Schiffer <mschiffer@universe-factory.net>

A more sophisticated implementation could try to combine fragment checksums
when all fragments have CHECKSUM_COMPLETE and are split at even offsets.
For now, we just set ip_summed to CHECKSUM_NONE to avoid "hw csum failure"
warnings in the kernel log when fragmented frames are received. In
consequence, skb_pull_rcsum() can be replaced with skb_pull().

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: 610bfc6bc99b ("batman-adv: Receive fragmented packets and merge")
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>
---
 net/batman-adv/fragmentation.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/batman-adv/fragmentation.c b/net/batman-adv/fragmentation.c
index 22dde42fd80e..5afe641ee4b0 100644
--- a/net/batman-adv/fragmentation.c
+++ b/net/batman-adv/fragmentation.c
@@ -288,7 +288,8 @@ batadv_frag_merge_packets(struct hlist_head *chain)
 	/* Move the existing MAC header to just before the payload. (Override
 	 * the fragment header.)
 	 */
-	skb_pull_rcsum(skb_out, hdr_size);
+	skb_pull(skb_out, hdr_size);
+	skb_out->ip_summed = CHECKSUM_NONE;
 	memmove(skb_out->data - ETH_HLEN, skb_mac_header(skb_out), ETH_HLEN);
 	skb_set_mac_header(skb_out, -ETH_HLEN);
 	skb_reset_network_header(skb_out);
-- 
2.11.0


  parent reply	other threads:[~2018-03-02 17:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-02 17:51 [B.A.T.M.A.N.] [PATCH 0/7] pull request for net: batman-adv 2018-03-02 Simon Wunderlich
2018-03-02 17:51 ` [B.A.T.M.A.N.] [PATCH 1/7] batman-adv: fix packet checksum in receive path Simon Wunderlich
2018-03-02 17:51 ` Simon Wunderlich [this message]
2018-03-02 17:51 ` [B.A.T.M.A.N.] [PATCH 3/7] batman-adv: Ignore invalid batadv_iv_gw during netlink send Simon Wunderlich
2018-03-02 17:51 ` [B.A.T.M.A.N.] [PATCH 4/7] batman-adv: Ignore invalid batadv_v_gw " Simon Wunderlich
2018-03-02 17:51 ` [B.A.T.M.A.N.] [PATCH 5/7] batman-adv: Fix netlink dumping of BLA claims Simon Wunderlich
2018-03-02 17:51 ` [B.A.T.M.A.N.] [PATCH 6/7] batman-adv: Fix netlink dumping of BLA backbones Simon Wunderlich
2018-03-02 17:51 ` [B.A.T.M.A.N.] [PATCH 7/7] batman-adv: Fix internal interface indices types Simon Wunderlich
2018-03-04  4:53 ` [B.A.T.M.A.N.] [PATCH 0/7] pull request for net: batman-adv 2018-03-02 David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180302175142.11838-3-sw@simonwunderlich.de \
    --to=sw@simonwunderlich.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=mschiffer@universe-factory.net \
    --cc=netdev@vger.kernel.org \
    --cc=sven@narfation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).