netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xfrm: remove redundant replay_esn check
@ 2012-11-08 10:15 Ulrich Weber
  2012-11-09  3:00 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Weber @ 2012-11-08 10:15 UTC (permalink / raw)
  To: steffen.klassert; +Cc: netdev

x->replay_esn is already checked in if clause,
so remove check and ident properly

Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
---
 net/xfrm/xfrm_replay.c |   13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c
index 3efb07d..765f6fe 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;
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfrm: remove redundant replay_esn check
  2012-11-08 10:15 [PATCH] xfrm: remove redundant replay_esn check Ulrich Weber
@ 2012-11-09  3:00 ` David Miller
  2012-11-09  7:59   ` Steffen Klassert
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2012-11-09  3:00 UTC (permalink / raw)
  To: ulrich.weber; +Cc: steffen.klassert, netdev

From: Ulrich Weber <ulrich.weber@sophos.com>
Date: Thu, 8 Nov 2012 11:15:44 +0100

> x->replay_esn is already checked in if clause,
> so remove check and ident properly
> 
> Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>

Steffen, I assume you'll pick this one up.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] xfrm: remove redundant replay_esn check
  2012-11-09  3:00 ` David Miller
@ 2012-11-09  7:59   ` Steffen Klassert
  0 siblings, 0 replies; 3+ messages in thread
From: Steffen Klassert @ 2012-11-09  7:59 UTC (permalink / raw)
  To: David Miller; +Cc: ulrich.weber, netdev

On Thu, Nov 08, 2012 at 10:00:20PM -0500, David Miller wrote:
> From: Ulrich Weber <ulrich.weber@sophos.com>
> Date: Thu, 8 Nov 2012 11:15:44 +0100
> 
> > x->replay_esn is already checked in if clause,
> > so remove check and ident properly
> > 
> > Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
> 
> Steffen, I assume you'll pick this one up.

Yes, it was already in my queue. Now applied to ipsec-next.

Thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-11-09  7:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-08 10:15 [PATCH] xfrm: remove redundant replay_esn check Ulrich Weber
2012-11-09  3:00 ` David Miller
2012-11-09  7:59   ` Steffen Klassert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).