diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c index b1e5e368c..319eca02e 100644 --- a/src/libcharon/sa/ike_sa.c +++ b/src/libcharon/sa/ike_sa.c @@ -2341,6 +2341,9 @@ static bool redirect_established(private_ike_sa_t *this, identification_t *to) { return FALSE; } + /* mark the SA so it won't get reused even though it's established */ + set_condition(this, COND_REDIRECTED, TRUE); + new_priv = (private_ike_sa_t*)new; new->set_peer_cfg(new, this->peer_cfg); new_priv->redirected_from = this->other_host->clone(this->other_host); diff --git a/src/libcharon/sa/ike_sa_manager.c b/src/libcharon/sa/ike_sa_manager.c index c128cc078..fca61ce7c 100644 --- a/src/libcharon/sa/ike_sa_manager.c +++ b/src/libcharon/sa/ike_sa_manager.c @@ -1563,6 +1563,7 @@ METHOD(ike_sa_manager_t, checkout_by_config, ike_sa_t*, } if (entry->ike_sa->get_state(entry->ike_sa) == IKE_DELETING || entry->ike_sa->get_state(entry->ike_sa) == IKE_REKEYED || + entry->ike_sa->has_condition(entry->ike_sa, COND_REDIRECTED) || ike_sa_is_delete_queued(entry->ike_sa)) { /* skip IKE_SAs which are not usable, wake other waiting threads */ entry->condvar->signal(entry->condvar);