Skip to content
Snippets Groups Projects
Commit d41db9f3 authored by Linus Lüssing's avatar Linus Lüssing Committed by David S. Miller
Browse files

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
No related branches found
No related tags found
No related merge requests found
...@@ -1020,11 +1020,12 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br, ...@@ -1020,11 +1020,12 @@ static int br_ip6_multicast_mld2_report(struct net_bridge *br,
if (!pskb_may_pull(skb, if (!pskb_may_pull(skb,
len + sizeof(*grec) + len + sizeof(*grec) +
sizeof(struct in6_addr) * (*nsrcs))) sizeof(struct in6_addr) * ntohs(*nsrcs)))
return -EINVAL; return -EINVAL;
grec = (struct mld2_grec *)(skb->data + len); 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. */ /* We treat these as MLDv1 reports for now. */
switch (grec->grec_type) { switch (grec->grec_type) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment