All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ang Way Chuang <wcang79@gmail.com>
To: netdev@vger.kernel.org
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD
Date: Wed, 24 Aug 2011 15:10:50 +0900	[thread overview]
Message-ID: <4E5495EA.1080906@gmail.com> (raw)

Just saw Eric's patch for icmp6_type. Suspect this patch may have issue for reference
of ip6h after pskb_trim_rcsum()?

Checksum of ICMPv6 is not properly computed because the pseudo header is not used.
Thus, the MLD packet gets dropped by the bridge. This patch fixes the problem for my
testbed. This bug was made visible by commit ff9a57a62afbbe2d0f3a09af321f1fd7645f38a.

This patch has been tested on 3.0.3. Due to lack of understanding on the checksum
optimization and multicast snooping of the kernel stack, can someone please verify the
correctness of this patch?

Signed-off-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
---
index 2d85ca7..bbf361b 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1528,9 +1528,12 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
 			break;
 		/*FALLTHROUGH*/
 	case CHECKSUM_NONE:
-		skb2->csum = 0;
-		if (skb_checksum_complete(skb2))
+		if (!skb_csum_unnecessary(skb2) && csum_ipv6_magic(&ip6h->saddr,
+			&ip6h->daddr, skb2->len, IPPROTO_ICMPV6,
+			skb_checksum(skb2, 0, skb2->len, 0))) {
+			err = -EINVAL;
 			goto out;
+		}
 	}
 
 	err = 0;
---

             reply	other threads:[~2011-08-24  6:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24  6:10 Ang Way Chuang [this message]
2011-08-24  7:18 ` [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD Eric Dumazet
  -- strict thread matches above, loose matches on Subject: below --
2011-08-23  8:41 IPv6 multicast snooping behaviour on 2.6.39-rc2 and later Ang Way Chuang
2011-08-23  9:57 ` Eric Dumazet
2011-08-23 12:31   ` Ang Way Chuang
2011-08-23 13:10     ` Eric Dumazet
2011-08-23 14:04       ` Ang Way Chuang
2011-08-23 17:24         ` Ang Way Chuang
2011-08-24  4:56           ` [PATCH] bridge: Pseudo-header required for the checksum of ICMP6 header of MLD Ang Way Chuang
2011-08-24  5:06             ` 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=4E5495EA.1080906@gmail.com \
    --to=wcang79@gmail.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.