dect
/
linux-2.6
Archived
13
0
Fork 0

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>
This commit is contained in:
Linus Lüssing 2011-02-15 13:19:19 +00:00 committed by David S. Miller
parent 649e984d00
commit d41db9f3f7
1 changed files with 3 additions and 2 deletions

View File

@ -1020,11 +1020,12 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
if (!pskb_may_pull(skb,
len + sizeof(*grec) +
sizeof(struct in6_addr) * (*nsrcs)))
sizeof(struct in6_addr) * ntohs(*nsrcs)))
return -EINVAL;
grec = (struct mld2_grec *)(skb->data + len);
len += sizeof(*grec) + sizeof(struct in6_addr) * (*nsrcs);
len += sizeof(*grec) +
sizeof(struct in6_addr) * ntohs(*nsrcs);
/* We treat these as MLDv1 reports for now. */
switch (grec->grec_type) {