From: davem@davemloft.net Date: Sat, 19 Mar 2005 05:39:03 +0000 (-0800) Subject: [PATCH] Fix __xfrm_find_acq_byseq() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ebf0f01a315493367b4c069cca0b06b99b387fb3;p=thirdparty%2Fkernel%2Fstable.git [PATCH] Fix __xfrm_find_acq_byseq() This function, as it's name implies, is supposed to only return IPSEC objects which are in the XFRM_STATE_ACQ ("acquire") state. But it returns any object with the matching sequence number. This is wrong and confuses IPSEC daemons to no end. [XFRM]: xfrm_find_acq_byseq should only return XFRM_STATE_ACQ states. Signed-off-by: Patrick McHardy Signed-off-by: Chris Wright Signed-off-by: Greg Kroah-Hartman --- diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index e43aa8c274836..1fc36538ea624 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -609,7 +609,7 @@ static struct xfrm_state *__xfrm_find_acq_byseq(u32 seq) for (i = 0; i < XFRM_DST_HSIZE; i++) { list_for_each_entry(x, xfrm_state_bydst+i, bydst) { - if (x->km.seq == seq) { + if (x->km.seq == seq && x->km.state == XFRM_STATE_ACQ) { xfrm_state_hold(x); return x; }