[XFRM] STATE: Add a hook to find offset to be inserted header in outbound.
[linux-2.6-block.git] / net / ipv6 / xfrm6_output.c
index 48fccb1eca08ad31eae996995600924e1f491537..b4628fbf8ff598013f484147286a98fbe62653ff 100644 (file)
 #include <net/ipv6.h>
 #include <net/xfrm.h>
 
+int xfrm6_find_1stfragopt(struct xfrm_state *x, struct sk_buff *skb,
+                         u8 **prevhdr)
+{
+       return ip6_find_1stfragopt(skb, prevhdr);
+}
+
 static int xfrm6_tunnel_check_size(struct sk_buff *skb)
 {
        int mtu, ret = 0;
@@ -41,13 +47,13 @@ static int xfrm6_output_one(struct sk_buff *skb)
        struct xfrm_state *x = dst->xfrm;
        int err;
        
-       if (skb->ip_summed == CHECKSUM_HW) {
-               err = skb_checksum_help(skb, 0);
+       if (skb->ip_summed == CHECKSUM_PARTIAL) {
+               err = skb_checksum_help(skb);
                if (err)
                        goto error_nolock;
        }
 
-       if (x->props.mode) {
+       if (x->props.mode == XFRM_MODE_TUNNEL) {
                err = xfrm6_tunnel_check_size(skb);
                if (err)
                        goto error_nolock;
@@ -80,7 +86,7 @@ static int xfrm6_output_one(struct sk_buff *skb)
                }
                dst = skb->dst;
                x = dst->xfrm;
-       } while (x && !x->props.mode);
+       } while (x && (x->props.mode != XFRM_MODE_TUNNEL));
 
        IP6CB(skb)->flags |= IP6SKB_XFRM_TRANSFORMED;
        err = 0;
@@ -122,10 +128,10 @@ static int xfrm6_output_finish(struct sk_buff *skb)
 {
        struct sk_buff *segs;
 
-       if (!skb_shinfo(skb)->gso_size)
+       if (!skb_is_gso(skb))
                return xfrm6_output_finish2(skb);
 
-       skb->protocol = htons(ETH_P_IP);
+       skb->protocol = htons(ETH_P_IPV6);
        segs = skb_gso_segment(skb, 0);
        kfree_skb(skb);
        if (unlikely(IS_ERR(segs)))