Patchwork bridge: Bug fix for incorrect interpretation of MLDv2 maximum response code

login
register
mail settings
Submitter Ang Way Chuang
Date Dec. 14, 2012, 12:07 a.m.
Message ID <50CA6DA5.1020101@sfc.wide.ad.jp>
Download mbox | patch
Permalink /patch/206269/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Ang Way Chuang - Dec. 14, 2012, 12:07 a.m.
This patch fixes the incorrect interpretation of endianness of MLDv2 maximum response
code within bridge's multicast snooping code.

Signed-off-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ang Way Chuang - Dec. 14, 2012, 12:19 a.m.
On 14/12/2012 08:12, Stephen Hemminger wrote:
> On Fri, 14 Dec 2012 08:07:01 +0800
> Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:
>
>> This patch fixes the incorrect interpretation of endianness of MLDv2 maximum response
>> code within bridge's multicast snooping code.
>>
>> Signed-off-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
>> ---
>> diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
>> index 977c3ee..29c6283 100644
>> --- a/net/bridge/br_multicast.c
>> +++ b/net/bridge/br_multicast.c
>> @@ -1172,7 +1172,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
>>  		mld2q = (struct mld2_query *)icmp6_hdr(skb);
>>  		if (!mld2q->mld2q_nsrcs)
>>  			group = &mld2q->mld2q_mca;
>> -		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(mld2q->mld2q_mrc) : 1;
>> +		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(ntohs(mld2q->mld2q_mrc)) : 1;
>>  	}
>>  
>>  	if (!group)
> Already fixed as part of my patch to fix sparse warnings.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
aye, aye.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - Dec. 14, 2012, 12:23 a.m.
On Fri, 14 Dec 2012 08:19:04 +0800
Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:

> On 14/12/2012 08:12, Stephen Hemminger wrote:
> > On Fri, 14 Dec 2012 08:07:01 +0800
> > Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:
> >
> >> This patch fixes the incorrect interpretation of endianness of MLDv2 maximum response
> >> code within bridge's multicast snooping code.
> >>
> >> Signed-off-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
> >> ---
> >> diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
> >> index 977c3ee..29c6283 100644
> >> --- a/net/bridge/br_multicast.c
> >> +++ b/net/bridge/br_multicast.c
> >> @@ -1172,7 +1172,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
> >>  		mld2q = (struct mld2_query *)icmp6_hdr(skb);
> >>  		if (!mld2q->mld2q_nsrcs)
> >>  			group = &mld2q->mld2q_mca;
> >> -		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(mld2q->mld2q_mrc) : 1;
> >> +		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(ntohs(mld2q->mld2q_mrc)) : 1;
> >>  	}
> >>  
> >>  	if (!group)
> > Already fixed as part of my patch to fix sparse warnings.
> > --
> > To unsubscribe from this list: send the line "unsubscribe netdev" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> aye, aye.

Yours looks cleaner (I added a temp variable). You might want to submit
patch to switch to your oneline version.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Ang Way Chuang - Dec. 14, 2012, 12:35 a.m.
On 14/12/2012 08:23, Stephen Hemminger wrote:
> On Fri, 14 Dec 2012 08:19:04 +0800
> Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:
>
>> On 14/12/2012 08:12, Stephen Hemminger wrote:
>>> On Fri, 14 Dec 2012 08:07:01 +0800
>>> Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:
>>>
>>>> This patch fixes the incorrect interpretation of endianness of MLDv2 maximum response
>>>> code within bridge's multicast snooping code.
>>>>
>>>> Signed-off-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
>>>> ---
>>>> diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
>>>> index 977c3ee..29c6283 100644
>>>> --- a/net/bridge/br_multicast.c
>>>> +++ b/net/bridge/br_multicast.c
>>>> @@ -1172,7 +1172,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
>>>>  		mld2q = (struct mld2_query *)icmp6_hdr(skb);
>>>>  		if (!mld2q->mld2q_nsrcs)
>>>>  			group = &mld2q->mld2q_mca;
>>>> -		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(mld2q->mld2q_mrc) : 1;
>>>> +		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(ntohs(mld2q->mld2q_mrc)) : 1;
>>>>  	}
>>>>  
>>>>  	if (!group)
>>> Already fixed as part of my patch to fix sparse warnings.
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>>
>> aye, aye.
> Yours looks cleaner (I added a temp variable). You might want to submit
> patch to switch to your oneline version.
>
Well, the patch did get into the netdev mailing list. I think your direct reply arrived in my mailbox first before I received my own patch through netdev. By the way, I don't see your patch on net-next git. Otherwise, I wouldn't have gone through the trouble of debugging and testing it on my computer. Is there any other repo that I should watch out to avoid this kind of silly situation in the future?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
stephen hemminger - Dec. 14, 2012, 12:51 a.m.
On Fri, 14 Dec 2012 08:35:21 +0800
Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:

> On 14/12/2012 08:23, Stephen Hemminger wrote:
> > On Fri, 14 Dec 2012 08:19:04 +0800
> > Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:
> >
> >> On 14/12/2012 08:12, Stephen Hemminger wrote:
> >>> On Fri, 14 Dec 2012 08:07:01 +0800
> >>> Ang Way Chuang <wcang@sfc.wide.ad.jp> wrote:
> >>>
> >>>> This patch fixes the incorrect interpretation of endianness of MLDv2 maximum response
> >>>> code within bridge's multicast snooping code.
> >>>>
> >>>> Signed-off-by: Ang Way Chuang <wcang@sfc.wide.ad.jp>
> >>>> ---
> >>>> diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
> >>>> index 977c3ee..29c6283 100644
> >>>> --- a/net/bridge/br_multicast.c
> >>>> +++ b/net/bridge/br_multicast.c
> >>>> @@ -1172,7 +1172,7 @@ static int br_ip6_multicast_query(struct net_bridge *br,
> >>>>  		mld2q = (struct mld2_query *)icmp6_hdr(skb);
> >>>>  		if (!mld2q->mld2q_nsrcs)
> >>>>  			group = &mld2q->mld2q_mca;
> >>>> -		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(mld2q->mld2q_mrc) : 1;
> >>>> +		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(ntohs(mld2q->mld2q_mrc)) : 1;
> >>>>  	}
> >>>>  
> >>>>  	if (!group)
> >>> Already fixed as part of my patch to fix sparse warnings.
> >>> --
> >>> To unsubscribe from this list: send the line "unsubscribe netdev" in
> >>> the body of a message to majordomo@vger.kernel.org
> >>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >>>
> >> aye, aye.
> > Yours looks cleaner (I added a temp variable). You might want to submit
> > patch to switch to your oneline version.
> >
> Well, the patch did get into the netdev mailing list. I think your direct reply arrived in my mailbox first before I received my own patch through netdev. By the way, I don't see your patch on net-next git. Otherwise, I wouldn't have gone through the trouble of debugging and testing it on my computer. Is there any other repo that I should watch out to avoid this kind of silly situation in the future?

You didn't see it because net-next tree is currently closed/idle until Dave opens it up for next release (3.9)
At this time, the only patches are those in the net tree: 	
  git://git.kernel.org/pub/scm/linux/kernel/git/davem/net.git
Which is where fixes for the current release are staged for Linus.

commit eca2a43bb0d2c6ebd528be6acb30a88435abe307
Author: stephen hemminger <shemminger@vyatta.com>
Date:   Thu Dec 13 06:51:28 2012 +0000

    bridge: fix icmpv6 endian bug and other sparse warnings
    
    Fix the warnings reported by sparse on recent bridge multicast
    changes. Mostly just rcu annotation issues but in this case
    sparse found a real bug! The ICMPv6 mld2 query mrc
    values is in network byte order.
    
    Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>




--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index 977c3ee..29c6283 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -1172,7 +1172,7 @@  static int br_ip6_multicast_query(struct net_bridge *br,
 		mld2q = (struct mld2_query *)icmp6_hdr(skb);
 		if (!mld2q->mld2q_nsrcs)
 			group = &mld2q->mld2q_mca;
-		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(mld2q->mld2q_mrc) : 1;
+		max_delay = mld2q->mld2q_mrc ? MLDV2_MRC(ntohs(mld2q->mld2q_mrc)) : 1;
 	}
 
 	if (!group)