reset threads IKE_SA after checking other IKE_SAs

invoke updown script only if we have valid IKE_SA
This commit is contained in:
Martin Willi
2008-10-20 11:38:16 +00:00
parent 7790ab0f37
commit f2e1ff59ab
4 changed files with 26 additions and 9 deletions
+12 -9
View File
@@ -199,16 +199,19 @@ static bool child_state_change(listener_t *this, ike_sa_t *ike_sa,
{
child_sa_state_t old;
old = child_sa->get_state(child_sa);
if ((old == CHILD_INSTALLED && state != CHILD_REKEYING ) ||
(old == CHILD_DELETING && state == CHILD_DESTROYING))
if (ike_sa)
{
updown(ike_sa, child_sa, FALSE);
}
else if (state == CHILD_INSTALLED)
{
updown(ike_sa, child_sa, TRUE);
old = child_sa->get_state(child_sa);
if ((old == CHILD_INSTALLED && state != CHILD_REKEYING ) ||
(old == CHILD_DELETING && state == CHILD_DESTROYING))
{
updown(ike_sa, child_sa, FALSE);
}
else if (state == CHILD_INSTALLED)
{
updown(ike_sa, child_sa, TRUE);
}
}
return TRUE;
}