aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-10-09 16:33:35 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:55:03 -0400
commitb7c6538cd84f8072fad43bfce530f5bf695edbba (patch)
treee0ba79ffe7b79355985a45de9961b17a0462764f /net/xfrm
parent050f009e16f908932070313c1745d09dc69fd62b (diff)
[IPSEC]: Move state lock into x->type->output
This patch releases the lock on the state before calling x->type->output. It also adds the lock to the spots where they're currently needed. Most of those places (all except mip6) are expected to disappear with async crypto. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/xfrm')
-rw-r--r--net/xfrm/xfrm_output.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 9847baec4094..0eb3377602e9 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -67,15 +67,15 @@ int xfrm_output(struct sk_buff *skb)
67 if (err) 67 if (err)
68 goto error; 68 goto error;
69 69
70 err = x->type->output(x, skb);
71 if (err)
72 goto error;
73
74 x->curlft.bytes += skb->len; 70 x->curlft.bytes += skb->len;
75 x->curlft.packets++; 71 x->curlft.packets++;
76 72
77 spin_unlock_bh(&x->lock); 73 spin_unlock_bh(&x->lock);
78 74
75 err = x->type->output(x, skb);
76 if (err)
77 goto error_nolock;
78
79 if (!(skb->dst = dst_pop(dst))) { 79 if (!(skb->dst = dst_pop(dst))) {
80 err = -EHOSTUNREACH; 80 err = -EHOSTUNREACH;
81 goto error_nolock; 81 goto error_nolock;