Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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) {