Don't invoke updown hook when flushing SAs for IKEv1, tasks will do it

This commit is contained in:
Martin Willi
2012-03-20 17:31:36 +01:00
parent c654d949f3
commit 5b7fc76861
+12 -10
View File
@@ -1695,16 +1695,18 @@ METHOD(ike_sa_manager_t, flush, void,
while (enumerator->enumerate(enumerator, &entry, &segment))
{
charon->bus->set_sa(charon->bus, entry->ike_sa);
/* as the delete never gets processed, fire down events */
switch (entry->ike_sa->get_state(entry->ike_sa))
{
case IKE_ESTABLISHED:
case IKE_REKEYING:
case IKE_DELETING:
charon->bus->ike_updown(charon->bus, entry->ike_sa, FALSE);
break;
default:
break;
if (entry->ike_sa->get_version(entry->ike_sa) == IKEV2)
{ /* as the delete never gets processed, fire down events */
switch (entry->ike_sa->get_state(entry->ike_sa))
{
case IKE_ESTABLISHED:
case IKE_REKEYING:
case IKE_DELETING:
charon->bus->ike_updown(charon->bus, entry->ike_sa, FALSE);
break;
default:
break;
}
}
entry->ike_sa->delete(entry->ike_sa);
}