Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[linux-drm-fsl-dcu.git] / net / ipv6 / mip6.c
index 99d116caecda4a503be815ec921afc2e3e5a976f..0afcabdd8ed6c9a52d434cce18ca96495dcc591c 100644 (file)
@@ -22,7 +22,6 @@
  *     Masahide NAKAMURA @USAGI
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/time.h>
@@ -90,7 +89,6 @@ static int mip6_mh_len(int type)
 int mip6_mh_filter(struct sock *sk, struct sk_buff *skb)
 {
        struct ip6_mh *mh;
-       int mhlen;
 
        if (!pskb_may_pull(skb, (skb->h.raw - skb->data) + 8) ||
            !pskb_may_pull(skb, (skb->h.raw - skb->data) + ((skb->h.raw[1] + 1) << 3)))
@@ -104,31 +102,6 @@ int mip6_mh_filter(struct sock *sk, struct sk_buff *skb)
                mip6_param_prob(skb, 0, (&mh->ip6mh_hdrlen) - skb->nh.raw);
                return -1;
        }
-       mhlen = (mh->ip6mh_hdrlen + 1) << 3;
-
-       if (skb->ip_summed == CHECKSUM_COMPLETE) {
-               skb->ip_summed = CHECKSUM_UNNECESSARY;
-               if (csum_ipv6_magic(&skb->nh.ipv6h->saddr,
-                                   &skb->nh.ipv6h->daddr,
-                                   mhlen, IPPROTO_MH,
-                                   skb->csum)) {
-                       LIMIT_NETDEBUG(KERN_DEBUG "mip6: MH hw checksum failed\n");
-                       skb->ip_summed = CHECKSUM_NONE;
-               }
-       }
-       if (skb->ip_summed == CHECKSUM_NONE) {
-               if (csum_ipv6_magic(&skb->nh.ipv6h->saddr,
-                                   &skb->nh.ipv6h->daddr,
-                                   mhlen, IPPROTO_MH,
-                                   skb_checksum(skb, 0, mhlen, 0))) {
-                       LIMIT_NETDEBUG(KERN_DEBUG "mip6: MH checksum failed "
-                                      "[" NIP6_FMT " > " NIP6_FMT "]\n",
-                                      NIP6(skb->nh.ipv6h->saddr),
-                                      NIP6(skb->nh.ipv6h->daddr));
-                       return -1;
-               }
-               skb->ip_summed = CHECKSUM_UNNECESSARY;
-       }
 
        if (mh->ip6mh_proto != IPPROTO_NONE) {
                LIMIT_NETDEBUG(KERN_DEBUG "mip6: MH invalid payload proto = %d\n",
@@ -263,10 +236,10 @@ static int mip6_destopt_reject(struct xfrm_state *x, struct sk_buff *skb, struct
        sel.proto = fl->proto;
        sel.dport = xfrm_flowi_dport(fl);
        if (sel.dport)
-               sel.dport_mask = ~((__u16)0);
+               sel.dport_mask = htons(~0);
        sel.sport = xfrm_flowi_sport(fl);
        if (sel.sport)
-               sel.sport_mask = ~((__u16)0);
+               sel.sport_mask = htons(~0);
        sel.ifindex = fl->oif;
 
        err = km_report(IPPROTO_DSTOPTS, &sel,
@@ -360,7 +333,7 @@ static struct xfrm_type mip6_destopt_type =
        .destructor     = mip6_destopt_destroy,
        .input          = mip6_destopt_input,
        .output         = mip6_destopt_output,
-       .reject         = mip6_destopt_reject,
+       .reject         = mip6_destopt_reject,
        .hdr_offset     = mip6_destopt_offset,
        .local_addr     = mip6_xfrm_addr,
 };