Commit d41db9f3 authored by Linus Lüssing's avatar Linus Lüssing Committed by David S. Miller

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: default avatarLinus Lüssing <linus.luessing@web.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 649e984d
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment