]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[IPSEC]: Add xfrm_input_state helper
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 11 Dec 2007 09:53:43 +0000 (01:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:57:05 +0000 (14:57 -0800)
This patch adds the xfrm_input_state helper function which returns the
current xfrm state being processed on the input path given an sk_buff.
This is currently only used by xfrm_input but will be used by ESP upon
asynchronous resumption.

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_input.c

index 503d0d294a4cc0a6e9ed287c82b12b9151151fd0..fe881b6e2bd059dc188fd0257a111e3b86ff8c8c 100644 (file)
@@ -1317,4 +1317,9 @@ static inline void xfrm_states_delete(struct xfrm_state **states, int n)
 }
 #endif
 
+static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb)
+{
+       return skb->sp->xvec[skb->sp->len - 1];
+}
+
 #endif /* _NET_XFRM_H */
index 8b2b1b59133ec20e28e96dc83f1499aca6eafe31..8624cbdb2a1eea89627c3ee28e56b51c50cc87c8 100644 (file)
@@ -109,7 +109,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
        /* A negative encap_type indicates async resumption. */
        if (encap_type < 0) {
                async = 1;
-               x = skb->sp->xvec[skb->sp->len - 1];
+               x = xfrm_input_state(skb);
                seq = XFRM_SKB_CB(skb)->seq;
                goto resume;
        }