From: "Linus Lüssing" <linus.luessing@web.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: bridge@lists.linux-foundation.org,
Stephen Hemminger <shemminger@linux-foundation.org>,
David Miller <davem@davemloft.net>,
YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH] bridge: mcast snooping, fix IPv6 MLD checksum calculation
Date: Sun, 27 Mar 2011 09:06:45 +0200 [thread overview]
Message-ID: <20110327070645.GA1734@Sellars> (raw)
In-Reply-To: <20110327063749.GA24299@gondor.apana.org.au>
So instead of 'if (!csum_fold(skb2->csum))' it should be this?
---
if (!csum_ipv6_magic(&ip6h->saddr, &ip6h->daddr,
skb2->len, nexthdr, skb2->csum))
---
(I'm peeking a little bit at
http://lxr.linux.no/linux+*/net/ipv6/netfilter.c#L98)
Hmm, if so, then I don't know how to test and verify that now though.
Cheers, Linus
On Sun, Mar 27, 2011 at 02:37:49PM +0800, Herbert Xu wrote:
> On Sun, Mar 27, 2011 at 08:27:23AM +0200, Linus Lüssing wrote:
> > In contrast to IGMP, the MLDv1/2 message checksum needs to include an
> > IPv6 "pseudo-header" in the calculations (see RFC2710, section 3.3;
> > RFC3810, section 5.1.2).
> >
> > The multicast snooping feature of the bridge code however did not take
> > this "pseudo-header" into consideration for the checksum validation when
> > parsing a snooped IPv6 MLDv1/2 message of another host, leading to
> > possibly ignored, though valid MLDv1/2 messages. This commit shall fix
> > this issue.
> >
> > Signed-off-by: Linus Lüssing <linus.luessing@web.de>
> > ---
> > net/bridge/br_multicast.c | 5 ++++-
> > 1 files changed, 4 insertions(+), 1 deletions(-)
> >
> > diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
> > index f61eb2e..47fae4f 100644
> > --- a/net/bridge/br_multicast.c
> > +++ b/net/bridge/br_multicast.c
> > @@ -1525,7 +1525,10 @@ static int br_multicast_ipv6_rcv(struct net_bridge *br,
> > break;
> > /*FALLTHROUGH*/
> > case CHECKSUM_NONE:
> > - skb2->csum = 0;
> > + skb2->csum = ~csum_unfold(csum_ipv6_magic(&ip6h->saddr,
> > + &ip6h->daddr,
> > + skb2->len,
> > + nexthdr, 0));
>
> You also need to include the pseudo-header for the CHECKSUM_COMPLETE
> case, before we've fallen through (which only happens if the
> hardware checksum doesn't match).
>
> Thanks,
> --
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
>
next prev parent reply other threads:[~2011-03-27 7:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-27 3:44 Checksumming bug in bridge multicast snooping for IPv6? Linus Lüssing
2011-03-27 6:27 ` bridge: mcast snooping, fixes for IPv6 MLDv1/2 parsing Linus Lüssing
2011-03-27 6:27 ` [PATCH] bridge: mcast snooping, fix IPv6 MLD checksum calculation Linus Lüssing
2011-03-27 6:37 ` Herbert Xu
2011-03-27 7:06 ` Linus Lüssing [this message]
2011-03-27 7:52 ` Herbert Xu
2011-03-30 9:29 ` David Miller
2011-03-27 6:27 ` [PATCH] bridge: mcast snooping, fix length check of snooped MLDv1/2 Linus Lüssing
2011-03-30 9:30 ` 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=20110327070645.GA1734@Sellars \
--to=linus.luessing@web.de \
--cc=bridge@lists.linux-foundation.org \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
--cc=yoshfuji@linux-ipv6.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).