Netdev List
 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

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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox