aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/icmp.c
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-05-07 19:52:29 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-08 23:47:50 -0400
commit39471ac8dde690bf944248e06bec32a4568cdd45 (patch)
treee6fb6ac43f69e05951b251a80ffb9f1e92ea302d /net/ipv6/icmp.c
parent29a96e1f36dbd6fc7911a6d517625c656ba4809f (diff)
icmp6: Call skb_checksum_validate
Use skb_checksum_validate to verify checksum. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/icmp.c')
-rw-r--r--net/ipv6/icmp.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c
index 3b0905b77127..8d3952796d39 100644
--- a/net/ipv6/icmp.c
+++ b/net/ipv6/icmp.c
@@ -692,22 +692,11 @@ static int icmpv6_rcv(struct sk_buff *skb)
692 saddr = &ipv6_hdr(skb)->saddr; 692 saddr = &ipv6_hdr(skb)->saddr;
693 daddr = &ipv6_hdr(skb)->daddr; 693 daddr = &ipv6_hdr(skb)->daddr;
694 694
695 /* Perform checksum. */ 695 if (skb_checksum_validate(skb, IPPROTO_ICMPV6, ip6_compute_pseudo)) {
696 switch (skb->ip_summed) { 696 LIMIT_NETDEBUG(KERN_DEBUG
697 case CHECKSUM_COMPLETE: 697 "ICMPv6 checksum failed [%pI6c > %pI6c]\n",
698 if (!csum_ipv6_magic(saddr, daddr, skb->len, IPPROTO_ICMPV6, 698 saddr, daddr);
699 skb->csum)) 699 goto csum_error;
700 break;
701 /* fall through */
702 case CHECKSUM_NONE:
703 skb->csum = ~csum_unfold(csum_ipv6_magic(saddr, daddr, skb->len,
704 IPPROTO_ICMPV6, 0));
705 if (__skb_checksum_complete(skb)) {
706 LIMIT_NETDEBUG(KERN_DEBUG
707 "ICMPv6 checksum failed [%pI6c > %pI6c]\n",
708 saddr, daddr);
709 goto csum_error;
710 }
711 } 700 }
712 701
713 if (!pskb_pull(skb, sizeof(*hdr))) 702 if (!pskb_pull(skb, sizeof(*hdr)))