提交 39471ac8 编写于 作者: T Tom Herbert 提交者: David S. Miller

icmp6: Call skb_checksum_validate

Use skb_checksum_validate to verify checksum.
Signed-off-by: NTom Herbert <therbert@google.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 29a96e1f
...@@ -692,22 +692,11 @@ static int icmpv6_rcv(struct sk_buff *skb) ...@@ -692,22 +692,11 @@ static int icmpv6_rcv(struct sk_buff *skb)
saddr = &ipv6_hdr(skb)->saddr; saddr = &ipv6_hdr(skb)->saddr;
daddr = &ipv6_hdr(skb)->daddr; daddr = &ipv6_hdr(skb)->daddr;
/* Perform checksum. */ if (skb_checksum_validate(skb, IPPROTO_ICMPV6, ip6_compute_pseudo)) {
switch (skb->ip_summed) { LIMIT_NETDEBUG(KERN_DEBUG
case CHECKSUM_COMPLETE: "ICMPv6 checksum failed [%pI6c > %pI6c]\n",
if (!csum_ipv6_magic(saddr, daddr, skb->len, IPPROTO_ICMPV6, saddr, daddr);
skb->csum)) goto csum_error;
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)) {
LIMIT_NETDEBUG(KERN_DEBUG
"ICMPv6 checksum failed [%pI6c > %pI6c]\n",
saddr, daddr);
goto csum_error;
}
} }
if (!pskb_pull(skb, sizeof(*hdr))) if (!pskb_pull(skb, sizeof(*hdr)))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册