]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv4/xfrm4_output.c
x86: unification of cfufreq/Kconfig
[linux-2.6-omap-h63xx.git] / net / ipv4 / xfrm4_output.c
index 04805c7d79c383359ae895672f2dc24079e1e804..c4a7156962bd58797d93b7c21051bcc797c98de9 100644 (file)
@@ -44,9 +44,10 @@ static inline int xfrm4_output_one(struct sk_buff *skb)
 {
        struct dst_entry *dst = skb->dst;
        struct xfrm_state *x = dst->xfrm;
+       struct iphdr *iph;
        int err;
 
-       if (x->props.mode == XFRM_MODE_TUNNEL) {
+       if (x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL) {
                err = xfrm4_tunnel_check_size(skb);
                if (err)
                        goto error_nolock;
@@ -56,6 +57,10 @@ static inline int xfrm4_output_one(struct sk_buff *skb)
        if (err)
                goto error_nolock;
 
+       iph = ip_hdr(skb);
+       iph->tot_len = htons(skb->len);
+       ip_send_check(iph);
+
        IPCB(skb)->flags |= IPSKB_XFRM_TRANSFORMED;
        err = 0;
 
@@ -73,7 +78,7 @@ static int xfrm4_output_finish2(struct sk_buff *skb)
        while (likely((err = xfrm4_output_one(skb)) == 0)) {
                nf_reset(skb);
 
-               err = nf_hook(PF_INET, NF_IP_LOCAL_OUT, &skb, NULL,
+               err = nf_hook(PF_INET, NF_IP_LOCAL_OUT, skb, NULL,
                              skb->dst->dev, dst_output);
                if (unlikely(err != 1))
                        break;
@@ -81,7 +86,7 @@ static int xfrm4_output_finish2(struct sk_buff *skb)
                if (!skb->dst->xfrm)
                        return dst_output(skb);
 
-               err = nf_hook(PF_INET, NF_IP_POST_ROUTING, &skb, NULL,
+               err = nf_hook(PF_INET, NF_IP_POST_ROUTING, skb, NULL,
                              skb->dst->dev, xfrm4_output_finish2);
                if (unlikely(err != 1))
                        break;