diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2007-11-14 00:39:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 17:53:44 -0500 |
commit | a2deb6d26f16ed7bf787dbd6a58c5d7be47d8db3 (patch) | |
tree | a8c1ef4007cd8d419aa8d8a218092b00dcd64757 /net/xfrm/xfrm_output.c | |
parent | e40b3286158565909692e5914ea4a11bdbcc68c8 (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/xfrm/xfrm_output.c')
-rw-r--r-- | net/xfrm/xfrm_output.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 58d5a746b1c3..b1efdc8850a7 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c | |||
@@ -53,6 +53,10 @@ int xfrm_output(struct sk_buff *skb) | |||
53 | } | 53 | } |
54 | 54 | ||
55 | do { | 55 | do { |
56 | err = x->outer_mode->output(x, skb); | ||
57 | if (err) | ||
58 | goto error; | ||
59 | |||
56 | spin_lock_bh(&x->lock); | 60 | spin_lock_bh(&x->lock); |
57 | err = xfrm_state_check(x, skb); | 61 | err = xfrm_state_check(x, skb); |
58 | if (err) | 62 | if (err) |
@@ -64,10 +68,6 @@ int xfrm_output(struct sk_buff *skb) | |||
64 | xfrm_replay_notify(x, XFRM_REPLAY_UPDATE); | 68 | xfrm_replay_notify(x, XFRM_REPLAY_UPDATE); |
65 | } | 69 | } |
66 | 70 | ||
67 | err = x->outer_mode->output(x, skb); | ||
68 | if (err) | ||
69 | goto error; | ||
70 | |||
71 | x->curlft.bytes += skb->len; | 71 | x->curlft.bytes += skb->len; |
72 | x->curlft.packets++; | 72 | x->curlft.packets++; |
73 | 73 | ||