[IPSEC]: Move output replay code into xfrm_output
The replay counter is one of only two remaining things in the output code that requires a lock on the xfrm state (the other being the crypto). This patch moves it into the generic xfrm_output so we can remove the lock from the transforms themselves. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
83815dea47
commit
436a0a4022
@ -95,8 +95,7 @@ static int esp6_output(struct xfrm_state *x, struct sk_buff *skb)
|
||||
*skb_network_header(skb) = IPPROTO_ESP;
|
||||
|
||||
esph->spi = x->id.spi;
|
||||
esph->seq_no = htonl(++x->replay.oseq);
|
||||
xfrm_aevent_doreplay(x);
|
||||
esph->seq_no = htonl(XFRM_SKB_CB(skb)->seq);
|
||||
|
||||
if (esp->conf.ivlen) {
|
||||
if (unlikely(!esp->conf.ivinitted)) {
|
||||
@ -373,6 +372,7 @@ static struct xfrm_type esp6_type =
|
||||
.description = "ESP6",
|
||||
.owner = THIS_MODULE,
|
||||
.proto = IPPROTO_ESP,
|
||||
.flags = XFRM_TYPE_REPLAY_PROT,
|
||||
.init_state = esp6_init_state,
|
||||
.destructor = esp6_destroy,
|
||||
.get_mtu = esp6_get_mtu,
|
||||
|
Reference in New Issue
Block a user