summaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_input.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-11-13 21:45:58 -0800
committerDavid S. Miller <davem@davemloft.net>2008-01-28 14:53:52 -0800
commit0ebea8ef3559b545c37b016f44e84c3b33e47c39 (patch)
tree7a47787c1b830084ac2d36371490b9e2574e2472 /net/xfrm/xfrm_input.c
parent668dc8af3150f837f7f0461001bbbc0ce25d7bdf (diff)
downloadop-kernel-dev-0ebea8ef3559b545c37b016f44e84c3b33e47c39.zip
op-kernel-dev-0ebea8ef3559b545c37b016f44e84c3b33e47c39.tar.gz
[IPSEC]: Move state lock into x->type->input
This patch releases the lock on the state before calling x->type->input. 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/xfrm_input.c')
-rw-r--r--net/xfrm/xfrm_input.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
index b7d68eb..5cad522 100644
--- a/net/xfrm/xfrm_input.c
+++ b/net/xfrm/xfrm_input.c
@@ -146,7 +146,11 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
if (xfrm_state_check_expire(x))
goto drop_unlock;
+ spin_unlock(&x->lock);
+
nexthdr = x->type->input(x, skb);
+
+ spin_lock(&x->lock);
if (nexthdr <= 0) {
if (nexthdr == -EBADMSG)
x->stats.integrity_failed++;
OpenPOWER on IntegriCloud