提交 d41db9f3 编写于 作者: L Linus Lüssing 提交者: 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: NLinus Lüssing <linus.luessing@web.de>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册