gre6: Call skb_checksum_simple_validate
authorTom Herbert <therbert@google.com>
Wed, 7 May 2014 23:51:57 +0000 (16:51 -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/ipv6/ip6_gre.c

index 75277b739b0424eab8ef83081b1e7756966f2877..3873181ed85614a28f9857d7d53acf2be9d2b9fb 100644 (file)
@@ -468,17 +468,7 @@ static int ip6gre_rcv(struct sk_buff *skb)
                        goto drop;
 
                if (flags&GRE_CSUM) {
-                       switch (skb->ip_summed) {
-                       case CHECKSUM_COMPLETE:
-                               csum = csum_fold(skb->csum);
-                               if (!csum)
-                                       break;
-                               /* fall through */
-                       case CHECKSUM_NONE:
-                               skb->csum = 0;
-                               csum = __skb_checksum_complete(skb);
-                               skb->ip_summed = CHECKSUM_COMPLETE;
-                       }
+                       csum = skb_checksum_simple_validate(skb);
                        offset += 4;
                }
                if (flags&GRE_KEY) {