All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bridge: add a missing ntohs()
@ 2010-04-20 13:20 Eric Dumazet
  2010-04-20 13:30 ` Herbert Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2010-04-20 13:20 UTC (permalink / raw)
  To: Herbert Xu, David Miller; +Cc: netdev

Found by code review and sparse endianness warning, I am not sure this
patch is valid.

Thanks

[PATCH] bridge: add a missing ntohs()

grec_nsrcs is in network order, we should convert to host horder in
br_multicast_igmp3_report()

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
index f29ada8..386c153 100644
--- a/net/bridge/br_multicast.c
+++ b/net/bridge/br_multicast.c
@@ -727,7 +727,7 @@ static int br_multicast_igmp3_report(struct net_bridge *br,
 		group = grec->grec_mca;
 		type = grec->grec_type;
 
-		len += grec->grec_nsrcs * 4;
+		len += ntohs(grec->grec_nsrcs) * 4;
 		if (!pskb_may_pull(skb, len))
 			return -EINVAL;
 




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] bridge: add a missing ntohs()
  2010-04-20 13:20 [PATCH] bridge: add a missing ntohs() Eric Dumazet
@ 2010-04-20 13:30 ` Herbert Xu
  2010-04-21  1:21   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Xu @ 2010-04-20 13:30 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David Miller, netdev

On Tue, Apr 20, 2010 at 03:20:05PM +0200, Eric Dumazet wrote:
> Found by code review and sparse endianness warning, I am not sure this
> patch is valid.
> 
> Thanks
> 
> [PATCH] bridge: add a missing ntohs()
> 
> grec_nsrcs is in network order, we should convert to host horder in
> br_multicast_igmp3_report()
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Thanks Eric!
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] bridge: add a missing ntohs()
  2010-04-20 13:30 ` Herbert Xu
@ 2010-04-21  1:21   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-04-21  1:21 UTC (permalink / raw)
  To: herbert; +Cc: eric.dumazet, netdev

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 20 Apr 2010 21:30:16 +0800

> On Tue, Apr 20, 2010 at 03:20:05PM +0200, Eric Dumazet wrote:
>> Found by code review and sparse endianness warning, I am not sure this
>> patch is valid.
>> 
>> Thanks
>> 
>> [PATCH] bridge: add a missing ntohs()
>> 
>> grec_nsrcs is in network order, we should convert to host horder in
>> br_multicast_igmp3_report()
>> 
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> 
> Acked-by: Herbert Xu <herbert@gondor.apana.org.au>

Good catch Eric.

Note that this means that most igmpv3_grec entries get ignored
on little-endian because the greg_nsrcs will look "real big"
and thus the pskb_may_pull() will fail.

Anyways I'll apply this to net-2.6, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-21  1:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-20 13:20 [PATCH] bridge: add a missing ntohs() Eric Dumazet
2010-04-20 13:30 ` Herbert Xu
2010-04-21  1:21   ` David Miller

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.