diff options
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_output.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 3c277a4d0e78..26fa0cb78c94 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c | |||
@@ -33,16 +33,6 @@ static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb) | |||
33 | return 0; | 33 | return 0; |
34 | } | 34 | } |
35 | 35 | ||
36 | static int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb) | ||
37 | { | ||
38 | int err = xfrm_state_check_expire(x); | ||
39 | if (err < 0) | ||
40 | goto err; | ||
41 | err = xfrm_state_check_space(x, skb); | ||
42 | err: | ||
43 | return err; | ||
44 | } | ||
45 | |||
46 | static int xfrm_output_one(struct sk_buff *skb, int err) | 36 | static int xfrm_output_one(struct sk_buff *skb, int err) |
47 | { | 37 | { |
48 | struct dst_entry *dst = skb->dst; | 38 | struct dst_entry *dst = skb->dst; |
@@ -52,12 +42,16 @@ static int xfrm_output_one(struct sk_buff *skb, int err) | |||
52 | goto resume; | 42 | goto resume; |
53 | 43 | ||
54 | do { | 44 | do { |
45 | err = xfrm_state_check_space(x, skb); | ||
46 | if (err) | ||
47 | goto error_nolock; | ||
48 | |||
55 | err = x->outer_mode->output(x, skb); | 49 | err = x->outer_mode->output(x, skb); |
56 | if (err) | 50 | if (err) |
57 | goto error; | 51 | goto error_nolock; |
58 | 52 | ||
59 | spin_lock_bh(&x->lock); | 53 | spin_lock_bh(&x->lock); |
60 | err = xfrm_state_check(x, skb); | 54 | err = xfrm_state_check_expire(x); |
61 | if (err) | 55 | if (err) |
62 | goto error; | 56 | goto error; |
63 | 57 | ||