]> err.no Git - linux-2.6/blobdiff - net/xfrm/xfrm_output.c
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
[linux-2.6] / net / xfrm / xfrm_output.c
index 40d75eccdddab669172ca6a8f6d844fe54f47091..f4bfd6c4565119f9f3be6cb80547922b930b4f73 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/netdevice.h>
 #include <linux/skbuff.h>
 #include <linux/spinlock.h>
-#include <linux/time.h>
 #include <net/dst.h>
 #include <net/xfrm.h>
 
@@ -64,23 +63,18 @@ int xfrm_output(struct sk_buff *skb)
                                xfrm_replay_notify(x, XFRM_REPLAY_UPDATE);
                }
 
-               err = x->mode->output(x, skb);
-               if (err)
-                       goto error;
-
-               err = x->type->output(x, skb);
+               err = x->outer_mode->output(x, skb);
                if (err)
                        goto error;
 
                x->curlft.bytes += skb->len;
                x->curlft.packets++;
 
-               if (x->props.mode == XFRM_MODE_ROUTEOPTIMIZATION)
-                       x->lastused = get_seconds();
-
                spin_unlock_bh(&x->lock);
 
-               skb_reset_network_header(skb);
+               err = x->type->output(x, skb);
+               if (err)
+                       goto error_nolock;
 
                if (!(skb->dst = dst_pop(dst))) {
                        err = -EHOSTUNREACH;
@@ -88,7 +82,7 @@ int xfrm_output(struct sk_buff *skb)
                }
                dst = skb->dst;
                x = dst->xfrm;
-       } while (x && (x->props.mode != XFRM_MODE_TUNNEL));
+       } while (x && !(x->outer_mode->flags & XFRM_MODE_FLAG_TUNNEL));
 
        err = 0;