This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / net / ipv6 / xfrm6_state.c
index d98b92d..c72cf83 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/ipsec.h>
 #include <net/ipv6.h>
 
-static struct xfrm_state_afinfo xfrm6_state_afinfo;
+extern struct xfrm_state_afinfo xfrm6_state_afinfo;
 
 static void
 __xfrm6_init_tempsel(struct xfrm_state *x, struct flowi *fl,
@@ -81,8 +81,11 @@ __xfrm6_find_acq(u8 mode, u32 reqid, u8 proto,
                    proto == x->id.proto &&
                    !ipv6_addr_cmp((struct in6_addr *)saddr, (struct in6_addr *)x->props.saddr.a6) &&
                    reqid == x->props.reqid &&
-                   x->km.state == XFRM_STATE_ACQ &&
-                   !x->id.spi) {
+                   x->km.state == XFRM_STATE_ACQ) {
+                           if (!x0)
+                                   x0 = x;
+                           if (x->id.spi)
+                                   continue;
                            x0 = x;
                            break;
                    }