netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Spang <spang@chromium.org>
To: Patrick McHardy <kaber@trash.net>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Michael Spang <spang@chromium.org>,
	stable@vger.kernel.org
Subject: [PATCH] macvlan: Fix checksum errors when ip_summed is CHECKSUM_PARTIAL
Date: Mon, 19 May 2014 13:24:14 -0400	[thread overview]
Message-ID: <1400520254-5142-1-git-send-email-spang@chromium.org> (raw)

Changing ip_summed from CHECKSUM_PARTIAL to CHECKSUM_UNNECESSARY
will result in an incorrect checksum if the packet is sent off the box.

Cc: stable@vger.kernel.org
Signed-off-by: Michael Spang <spang@chromium.org>
---
 drivers/net/macvlan.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index 753a8c2..806b56a 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -267,7 +267,9 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
 
 	if (vlan->mode == MACVLAN_MODE_BRIDGE) {
 		const struct ethhdr *eth = (void *)skb->data;
-		skb->ip_summed = CHECKSUM_UNNECESSARY;
+
+		if (skb->ip_summed == CHECKSUM_NONE)
+			skb->ip_summed = CHECKSUM_UNNECESSARY;
 
 		/* send to other bridge ports directly */
 		if (is_multicast_ether_addr(eth->h_dest)) {
-- 
2.0.0.rc2

             reply	other threads:[~2014-05-19 17:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-19 17:24 Michael Spang [this message]
2014-05-19 17:44 ` [PATCH] macvlan: Fix checksum errors when ip_summed is CHECKSUM_PARTIAL Eric Dumazet
2014-05-19 20:05   ` Michael Spang
2014-05-19 20:36     ` Cong Wang
2014-05-19 21:24 ` Vlad Yasevich

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=1400520254-5142-1-git-send-email-spang@chromium.org \
    --to=spang@chromium.org \
    --cc=kaber@trash.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=stable@vger.kernel.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).