icmp: Call skb_checksum_simple_validate
authorTom Herbert <therbert@google.com>
Wed, 7 May 2014 23:52:21 +0000 (16:52 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 9 May 2014 03:47:50 +0000 (23:47 -0400)
Use skb_checksum_simple_validate to verify checksum.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/icmp.c

index 0134663fdbce86f6da39d8f6c9d27ce6c404687c..fe52666dc43c9b3b6f03ecce294df1e88e4ca01c 100644 (file)
@@ -908,16 +908,8 @@ int icmp_rcv(struct sk_buff *skb)
 
        ICMP_INC_STATS_BH(net, ICMP_MIB_INMSGS);
 
-       switch (skb->ip_summed) {
-       case CHECKSUM_COMPLETE:
-               if (!csum_fold(skb->csum))
-                       break;
-               /* fall through */
-       case CHECKSUM_NONE:
-               skb->csum = 0;
-               if (__skb_checksum_complete(skb))
-                       goto csum_error;
-       }
+       if (skb_checksum_simple_validate(skb))
+               goto csum_error;
 
        if (!pskb_pull(skb, sizeof(*icmph)))
                goto error;