提交 00501121 编写于 作者: H Herbert Xu 提交者: David S. Miller

[IPSEC]: Add xfrm_input_state helper

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: NHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 385ac2e3
......@@ -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 */
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册