[IPSEC]: Move xfrm_state_check into xfrm_output.c
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 9 Oct 2007 00:25:08 +0000 (17:25 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Wed, 10 Oct 2007 23:54:54 +0000 (16:54 -0700)
The functions xfrm_state_check and xfrm_state_check_space are only used by
the output code in xfrm_output.c so we can move them over.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
net/xfrm/xfrm_output.c
net/xfrm/xfrm_state.c

index f5147ddb818ec588f245baa2bbafff329843d3c1..bb9193434eb362d050cedbc4197a0959a9035859 100644 (file)
@@ -1013,7 +1013,6 @@ extern void xfrm_spd_getinfo(struct xfrmk_spdinfo *si);
 extern int xfrm_replay_check(struct xfrm_state *x, __be32 seq);
 extern void xfrm_replay_advance(struct xfrm_state *x, __be32 seq);
 extern void xfrm_replay_notify(struct xfrm_state *x, int event);
-extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb);
 extern int xfrm_state_mtu(struct xfrm_state *x, int mtu);
 extern int xfrm_init_state(struct xfrm_state *x);
 extern int xfrm_output(struct sk_buff *skb);
index 75f289b488a709f2876afcd9aff16b24e05ff044..5b1c978a323c34a3cbb35020e17e6f4fc5943146 100644 (file)
 #include <net/dst.h>
 #include <net/xfrm.h>
 
+static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb)
+{
+       int nhead = x->props.header_len + LL_RESERVED_SPACE(skb->dst->dev)
+               - skb_headroom(skb);
+
+       if (nhead > 0)
+               return pskb_expand_head(skb, nhead, 0, GFP_ATOMIC);
+
+       /* Check tail too... */
+       return 0;
+}
+
+static int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb)
+{
+       int err = xfrm_state_check_expire(x);
+       if (err < 0)
+               goto err;
+       err = xfrm_state_check_space(x, skb);
+err:
+       return err;
+}
+
 int xfrm_output(struct sk_buff *skb)
 {
        struct dst_entry *dst = skb->dst;
index 15734adc9367396b9593298f3da9735825c870fa..0ecec34d265a390dbcb0be908b70f276511bda1f 100644 (file)
@@ -1152,29 +1152,6 @@ int xfrm_state_check_expire(struct xfrm_state *x)
 }
 EXPORT_SYMBOL(xfrm_state_check_expire);
 
-static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb)
-{
-       int nhead = x->props.header_len + LL_RESERVED_SPACE(skb->dst->dev)
-               - skb_headroom(skb);
-
-       if (nhead > 0)
-               return pskb_expand_head(skb, nhead, 0, GFP_ATOMIC);
-
-       /* Check tail too... */
-       return 0;
-}
-
-int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb)
-{
-       int err = xfrm_state_check_expire(x);
-       if (err < 0)
-               goto err;
-       err = xfrm_state_check_space(x, skb);
-err:
-       return err;
-}
-EXPORT_SYMBOL(xfrm_state_check);
-
 struct xfrm_state *
 xfrm_state_lookup(xfrm_address_t *daddr, __be32 spi, u8 proto,
                  unsigned short family)