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

Commit 39471ac8 authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller
Browse files

icmp6: Call skb_checksum_validate



Use skb_checksum_validate to verify checksum.

Signed-off-by: default avatarTom Herbert <therbert@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 29a96e1f
Loading
Loading
Loading
Loading
+5 −16
Original line number Diff line number Diff line
@@ -692,23 +692,12 @@ static int icmpv6_rcv(struct sk_buff *skb)
	saddr = &ipv6_hdr(skb)->saddr;
	daddr = &ipv6_hdr(skb)->daddr;

	/* Perform checksum. */
	switch (skb->ip_summed) {
	case CHECKSUM_COMPLETE:
		if (!csum_ipv6_magic(saddr, daddr, skb->len, IPPROTO_ICMPV6,
				     skb->csum))
			break;
		/* fall through */
	case CHECKSUM_NONE:
		skb->csum = ~csum_unfold(csum_ipv6_magic(saddr, daddr, skb->len,
					     IPPROTO_ICMPV6, 0));
		if (__skb_checksum_complete(skb)) {
	if (skb_checksum_validate(skb, IPPROTO_ICMPV6, ip6_compute_pseudo)) {
		LIMIT_NETDEBUG(KERN_DEBUG
			       "ICMPv6 checksum failed [%pI6c > %pI6c]\n",
			       saddr, daddr);
		goto csum_error;
	}
	}

	if (!pskb_pull(skb, sizeof(*hdr)))
		goto discard_it;