Invert check to delete unestablished IKE_SAs to not delete them once established
authorMartin Willi <martin@revosec.ch>
Wed, 9 Feb 2011 14:03:08 +0000 (15:03 +0100)
committerMartin Willi <martin@revosec.ch>
Mon, 28 Feb 2011 15:37:17 +0000 (15:37 +0000)
src/libcharon/processing/jobs/delete_ike_sa_job.c

index da3ecf0..468c9ef 100644 (file)
@@ -76,8 +76,8 @@ METHOD(job_t, execute, void,
                }
                else
                {
-                       /* destroy only if not ESTABLISHED */
-                       if (ike_sa->get_state(ike_sa) == IKE_ESTABLISHED)
+                       /* destroy IKE_SA did not complete connecting phase */
+                       if (ike_sa->get_state(ike_sa) != IKE_CONNECTING)
                        {
                                charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
                        }