trap-manager: Properly check-in IKE_SA if initiating fails

This basically reverts f4e822c1b4 ("trap-manager: don't check-in
nonexisting IKE_SA if acquire fails").  As checkout_by_config() could
return an already existing and established IKE_SA we have to properly
destroy it, for instance, in case other threads are waiting to check
it out.  checkin_and_destroy() should handle the case of a new SA
properly (it produces a log message on level 1, though).
This commit is contained in:
Tobias Brunner 2015-07-09 14:34:19 +02:00
parent 6f7a3b33bc
commit 773fcb1605
1 changed files with 2 additions and 2 deletions

View File

@ -377,8 +377,8 @@ METHOD(trap_manager_t, acquire, void,
}
else
{
ike_sa->destroy(ike_sa);
charon->bus->set_sa(charon->bus, NULL);
charon->ike_sa_manager->checkin_and_destroy(charon->ike_sa_manager,
ike_sa);
}
}
peer->destroy(peer);