]> git.hungrycats.org Git - linux/commitdiff
[PATCH] [IPSEC]: Fix __xfrm_find_acq_byseq()
authorDavid S. Miller <davem@davemloft.net>
Fri, 18 Mar 2005 13:39:03 +0000 (05:39 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Mar 2005 13:39:03 +0000 (05:39 -0800)
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 <kaber@trash.net>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/xfrm/xfrm_state.c

index e43aa8c274836ba048fae78a909f02c292944d8c..1fc36538ea624d71fe3b756327f89f78bf5fb672 100644 (file)
@@ -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;
                        }