ikev1: Trigger children_migrate event if CHILD_SAs are adopted

This commit is contained in:
Tobias Brunner
2015-05-21 15:38:31 +02:00
parent 072d9dc3c6
commit 6a9a69ae58
3 changed files with 12 additions and 1 deletions
@@ -64,11 +64,13 @@ METHOD(job_t, execute, job_requeue_t,
ike_sa_id_t *id;
ike_sa_t *ike_sa;
child_sa_t *child_sa;
u_int32_t unique;
ike_sa = charon->ike_sa_manager->checkout(charon->ike_sa_manager, this->id);
if (ike_sa)
{
/* get what we need from new SA */
unique = ike_sa->get_unique_id(ike_sa);
me = ike_sa->get_my_host(ike_sa);
me = me->clone(me);
other = ike_sa->get_other_host(ike_sa);
@@ -106,6 +108,7 @@ METHOD(job_t, execute, job_requeue_t,
other_id->equals(other_id, ike_sa->get_other_id(ike_sa)) &&
cfg->equals(cfg, ike_sa->get_peer_cfg(ike_sa)))
{
charon->bus->children_migrate(charon->bus, this->id, unique);
subenum = ike_sa->create_child_sa_enumerator(ike_sa);
while (subenum->enumerate(subenum, &child_sa))
{
@@ -176,6 +179,7 @@ METHOD(job_t, execute, job_requeue_t,
}
charon->bus->assign_vips(charon->bus, ike_sa, TRUE);
}
charon->bus->children_migrate(charon->bus, NULL, 0);
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
}
}