aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/xfrm6_mode_ro.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2007-11-14 00:39:38 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:53:44 -0500
commita2deb6d26f16ed7bf787dbd6a58c5d7be47d8db3 (patch)
treea8c1ef4007cd8d419aa8d8a218092b00dcd64757 /net/ipv6/xfrm6_mode_ro.c
parente40b3286158565909692e5914ea4a11bdbcc68c8 (diff)
[IPSEC]: Move x->outer_mode->output out of locked section
RO mode is the only one that requires a locked output function. So it's easier to move the lock into that function rather than requiring everyone else to run under the lock. In particular, this allows us to move the size check into the output function without causing a potential dead-lock should the ICMP error somehow hit the same SA on transmission. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/xfrm6_mode_ro.c')
-rw-r--r--net/ipv6/xfrm6_mode_ro.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/net/ipv6/xfrm6_mode_ro.c b/net/ipv6/xfrm6_mode_ro.c
index a7bc8c62317a..4a01cb3c370b 100644
--- a/net/ipv6/xfrm6_mode_ro.c
+++ b/net/ipv6/xfrm6_mode_ro.c
@@ -28,6 +28,7 @@
28#include <linux/kernel.h> 28#include <linux/kernel.h>
29#include <linux/module.h> 29#include <linux/module.h>
30#include <linux/skbuff.h> 30#include <linux/skbuff.h>
31#include <linux/spinlock.h>
31#include <linux/stringify.h> 32#include <linux/stringify.h>
32#include <linux/time.h> 33#include <linux/time.h>
33#include <net/ipv6.h> 34#include <net/ipv6.h>
@@ -53,7 +54,9 @@ static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb)
53 __skb_pull(skb, hdr_len); 54 __skb_pull(skb, hdr_len);
54 memmove(ipv6_hdr(skb), iph, hdr_len); 55 memmove(ipv6_hdr(skb), iph, hdr_len);
55 56
57 spin_lock_bh(&x->lock);
56 x->lastused = get_seconds(); 58 x->lastused = get_seconds();
59 spin_unlock_bh(&x->lock);
57 60
58 return 0; 61 return 0;
59} 62}