diff options
author | Linus Lüssing <linus.luessing@web.de> | 2011-02-15 08:19:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-22 13:07:27 -0500 |
commit | d41db9f3f71548f07b8b6d81a88220d0035b04f6 (patch) | |
tree | 14d56a73bccb0fdc6a00a79809fec94697817f6d /net/bridge/br_multicast.c | |
parent | 649e984d00416cb1a254fdbebd6d3f9fa01c32fa (diff) |
bridge: Add missing ntohs()s for MLDv2 report parsing
The nsrcs number is 2 Byte wide, therefore we need to call ntohs()
before using it.
Signed-off-by: Linus Lüssing <linus.luessing@web.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/bridge/br_multicast.c')
-rw-r--r-- | net/bridge/br_multicast.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index d69beaf8362..9ce2af18770 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -1020,11 +1020,12 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, | |||
1020 | 1020 | ||
1021 | if (!pskb_may_pull(skb, | 1021 | if (!pskb_may_pull(skb, |
1022 | len + sizeof(*grec) + | 1022 | len + sizeof(*grec) + |
1023 | sizeof(struct in6_addr) * (*nsrcs))) | 1023 | sizeof(struct in6_addr) * ntohs(*nsrcs))) |
1024 | return -EINVAL; | 1024 | return -EINVAL; |
1025 | 1025 | ||
1026 | grec = (struct mld2_grec *)(skb->data + len); | 1026 | grec = (struct mld2_grec *)(skb->data + len); |
1027 | len += sizeof(*grec) + sizeof(struct in6_addr) * (*nsrcs); | 1027 | len += sizeof(*grec) + |
1028 | sizeof(struct in6_addr) * ntohs(*nsrcs); | ||
1028 | 1029 | ||
1029 | /* We treat these as MLDv1 reports for now. */ | 1030 | /* We treat these as MLDv1 reports for now. */ |
1030 | switch (grec->grec_type) { | 1031 | switch (grec->grec_type) { |