Merge tag 'libnvdimm-for-6.10' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdim...
[linux-block.git] / net / xfrm / xfrm_replay.c
index ce56d659c55a692ed6ecf2d1fd4c31e6eff03449..bc56c6305725275ea2286373543af5d9333e34f4 100644 (file)
@@ -778,7 +778,8 @@ int xfrm_init_replay(struct xfrm_state *x, struct netlink_ext_ack *extack)
                }
 
                if (x->props.flags & XFRM_STATE_ESN) {
-                       if (replay_esn->replay_window == 0) {
+                       if (replay_esn->replay_window == 0 &&
+                           (!x->dir || x->dir == XFRM_SA_DIR_IN)) {
                                NL_SET_ERR_MSG(extack, "ESN replay window must be > 0");
                                return -EINVAL;
                        }