diff options
Diffstat (limited to 'net/xfrm/xfrm_replay.c')
-rw-r--r-- | net/xfrm/xfrm_replay.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c index f218385950ca..47f1b8638df9 100644 --- a/net/xfrm/xfrm_replay.c +++ b/net/xfrm/xfrm_replay.c | |||
@@ -532,9 +532,12 @@ int xfrm_init_replay(struct xfrm_state *x) | |||
532 | 532 | ||
533 | if (replay_esn) { | 533 | if (replay_esn) { |
534 | if (replay_esn->replay_window > | 534 | if (replay_esn->replay_window > |
535 | replay_esn->bmp_len * sizeof(__u32)) | 535 | replay_esn->bmp_len * sizeof(__u32) * 8) |
536 | return -EINVAL; | 536 | return -EINVAL; |
537 | 537 | ||
538 | if ((x->props.flags & XFRM_STATE_ESN) && replay_esn->replay_window == 0) | ||
539 | return -EINVAL; | ||
540 | |||
538 | if ((x->props.flags & XFRM_STATE_ESN) && x->replay_esn) | 541 | if ((x->props.flags & XFRM_STATE_ESN) && x->replay_esn) |
539 | x->repl = &xfrm_replay_esn; | 542 | x->repl = &xfrm_replay_esn; |
540 | else | 543 | else |