Blob Blame History Raw
commit bfb1f15c0f2d22987f67dd4dd41316eac28bdc26
Author: Wolfgang Nothdurft <Wolfgang.Nothdurft@linogate.de>
Date:   Fri Oct 2 13:20:14 2015 -0400

    pluto: Resolves lbz#233
    
    pluto sends delete SAs in wrong order and reconnection issues
    
    Signed-off-by: Paul Wouters <pwouters@redhat.com>

diff --git a/programs/pluto/state.c b/programs/pluto/state.c
index 7d0821f..b45c1ae 100644
--- a/programs/pluto/state.c
+++ b/programs/pluto/state.c
@@ -789,7 +789,7 @@ void delete_state(struct state *st)
 	/* tell the other side of any IPSEC SAs that are going down */
 	if (IS_IPSEC_SA_ESTABLISHED(st->st_state) ||
 			IS_ISAKMP_SA_ESTABLISHED(st->st_state)) {
-		if (IS_CHILD_SA(st) &&
+		if (st->st_ikev2 && IS_CHILD_SA(st) &&
 		    state_with_serialno(st->st_clonedfrom) == NULL) {
 			/* ??? in v2, there must be a parent */
 			DBG(DBG_CONTROL, DBG_log("deleting state but IKE SA does not exist for this child SA so Informational Exchange cannot be sent"));
@@ -971,8 +971,8 @@ static void foreach_states_by_connection_func_delete(struct connection *c,
 					    DBG_log("index %d state #%lu", i,
 						    this->st_serialno));
 
-				/* on pass 2, ignore phase2 states */
-				if (pass == 1 &&
+				/* on pass 1, ignore established ISAKMP SA's */
+				if (pass == 0 &&
 				    IS_ISAKMP_SA_ESTABLISHED(this->st_state))
 					continue;