diff options
author | Tom Herbert <therbert@google.com> | 2014-05-07 19:52:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-05-08 23:47:50 -0400 |
commit | 29a96e1f36dbd6fc7911a6d517625c656ba4809f (patch) | |
tree | 1a77a68f57237ce937162d77c84c64451647b78c /net/ipv4 | |
parent | de08dc1a8e7052f4cbaf920ce0af6bb261595705 (diff) |
icmp: Call skb_checksum_simple_validate
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>
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/icmp.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c index 0134663fdbce..fe52666dc43c 100644 --- a/net/ipv4/icmp.c +++ b/net/ipv4/icmp.c | |||
@@ -908,16 +908,8 @@ int icmp_rcv(struct sk_buff *skb) | |||
908 | 908 | ||
909 | ICMP_INC_STATS_BH(net, ICMP_MIB_INMSGS); | 909 | ICMP_INC_STATS_BH(net, ICMP_MIB_INMSGS); |
910 | 910 | ||
911 | switch (skb->ip_summed) { | 911 | if (skb_checksum_simple_validate(skb)) |
912 | case CHECKSUM_COMPLETE: | 912 | goto csum_error; |
913 | if (!csum_fold(skb->csum)) | ||
914 | break; | ||
915 | /* fall through */ | ||
916 | case CHECKSUM_NONE: | ||
917 | skb->csum = 0; | ||
918 | if (__skb_checksum_complete(skb)) | ||
919 | goto csum_error; | ||
920 | } | ||
921 | 913 | ||
922 | if (!pskb_pull(skb, sizeof(*icmph))) | 914 | if (!pskb_pull(skb, sizeof(*icmph))) |
923 | goto error; | 915 | goto error; |