diff options
author | Ulrich Weber <ulrich.weber@sophos.com> | 2012-11-08 11:15:44 +0100 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2012-11-08 12:42:49 +0100 |
commit | aafd0d88ee3a009b3f4f576a8e6e114d4810e489 (patch) | |
tree | 8880f427cc57d4f32d37fa24c5fb317d74f18f7c /net/xfrm | |
parent | f1e0b5b4f1eae56a3192688177f36e2bdf0e01ac (diff) |
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 <ulrich.weber@sophos.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/xfrm')
-rw-r--r-- | net/xfrm/xfrm_replay.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c index 3efb07d3eb27..765f6fe951eb 100644 --- a/net/xfrm/xfrm_replay.c +++ b/net/xfrm/xfrm_replay.c @@ -521,13 +521,12 @@ int xfrm_init_replay(struct xfrm_state *x) replay_esn->bmp_len * sizeof(__u32) * 8) return -EINVAL; - if ((x->props.flags & XFRM_STATE_ESN) && replay_esn->replay_window == 0) - return -EINVAL; - - if ((x->props.flags & XFRM_STATE_ESN) && x->replay_esn) - x->repl = &xfrm_replay_esn; - else - x->repl = &xfrm_replay_bmp; + if (x->props.flags & XFRM_STATE_ESN) { + if (replay_esn->replay_window == 0) + return -EINVAL; + x->repl = &xfrm_replay_esn; + } else + x->repl = &xfrm_replay_bmp; } else x->repl = &xfrm_replay_legacy; |