Skip to content

Commit aafd0d8

Browse files
Ulrich Weberklassert
Ulrich Weber
authored andcommitted
xfrm: remove redundant replay_esn check
x->replay_esn is already checked in if clause, so remove check and ident properly Signed-off-by: Ulrich Weber <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent f1e0b5b commit aafd0d8

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

net/xfrm/xfrm_replay.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -521,13 +521,12 @@ int xfrm_init_replay(struct xfrm_state *x)
521521
replay_esn->bmp_len * sizeof(__u32) * 8)
522522
return -EINVAL;
523523

524-
if ((x->props.flags & XFRM_STATE_ESN) && replay_esn->replay_window == 0)
525-
return -EINVAL;
526-
527-
if ((x->props.flags & XFRM_STATE_ESN) && x->replay_esn)
528-
x->repl = &xfrm_replay_esn;
529-
else
530-
x->repl = &xfrm_replay_bmp;
524+
if (x->props.flags & XFRM_STATE_ESN) {
525+
if (replay_esn->replay_window == 0)
526+
return -EINVAL;
527+
x->repl = &xfrm_replay_esn;
528+
} else
529+
x->repl = &xfrm_replay_bmp;
531530
} else
532531
x->repl = &xfrm_replay_legacy;
533532

0 commit comments

Comments
 (0)