xfrm: Check for the new replay implementation if an esn state is inserted

IPsec extended sequence numbers can be used only with the new
anti-replay window implementation. So check if the new implementation
is used if an esn state is inserted and return an error if it is not.

Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Steffen Klassert and committed by David S. Miller 7833aa05 c0a56e64

+3
+3
net/xfrm/xfrm_user.c
··· 124 124 { 125 125 struct nlattr *rt = attrs[XFRMA_REPLAY_ESN_VAL]; 126 126 127 + if ((p->flags & XFRM_STATE_ESN) && !rt) 128 + return -EINVAL; 129 + 127 130 if (!rt) 128 131 return 0; 129 132