diff options
Diffstat (limited to 'net/xfrm/xfrm_output.c')
-rw-r--r-- | net/xfrm/xfrm_output.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c index 75f289b488a7..5b1c978a323c 100644 --- a/net/xfrm/xfrm_output.c +++ b/net/xfrm/xfrm_output.c | |||
@@ -18,6 +18,28 @@ | |||
18 | #include <net/dst.h> | 18 | #include <net/dst.h> |
19 | #include <net/xfrm.h> | 19 | #include <net/xfrm.h> |
20 | 20 | ||
21 | static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb) | ||
22 | { | ||
23 | int nhead = x->props.header_len + LL_RESERVED_SPACE(skb->dst->dev) | ||
24 | - skb_headroom(skb); | ||
25 | |||
26 | if (nhead > 0) | ||
27 | return pskb_expand_head(skb, nhead, 0, GFP_ATOMIC); | ||
28 | |||
29 | /* Check tail too... */ | ||
30 | return 0; | ||
31 | } | ||
32 | |||
33 | static int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb) | ||
34 | { | ||
35 | int err = xfrm_state_check_expire(x); | ||
36 | if (err < 0) | ||
37 | goto err; | ||
38 | err = xfrm_state_check_space(x, skb); | ||
39 | err: | ||
40 | return err; | ||
41 | } | ||
42 | |||
21 | int xfrm_output(struct sk_buff *skb) | 43 | int xfrm_output(struct sk_buff *skb) |
22 | { | 44 | { |
23 | struct dst_entry *dst = skb->dst; | 45 | struct dst_entry *dst = skb->dst; |