ikev1: Trigger children_migrate event if CHILD_SAs are adopted
This commit is contained in:
@@ -64,11 +64,13 @@ METHOD(job_t, execute, job_requeue_t,
|
|||||||
ike_sa_id_t *id;
|
ike_sa_id_t *id;
|
||||||
ike_sa_t *ike_sa;
|
ike_sa_t *ike_sa;
|
||||||
child_sa_t *child_sa;
|
child_sa_t *child_sa;
|
||||||
|
u_int32_t unique;
|
||||||
|
|
||||||
ike_sa = charon->ike_sa_manager->checkout(charon->ike_sa_manager, this->id);
|
ike_sa = charon->ike_sa_manager->checkout(charon->ike_sa_manager, this->id);
|
||||||
if (ike_sa)
|
if (ike_sa)
|
||||||
{
|
{
|
||||||
/* get what we need from new 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 = ike_sa->get_my_host(ike_sa);
|
||||||
me = me->clone(me);
|
me = me->clone(me);
|
||||||
other = ike_sa->get_other_host(ike_sa);
|
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)) &&
|
other_id->equals(other_id, ike_sa->get_other_id(ike_sa)) &&
|
||||||
cfg->equals(cfg, ike_sa->get_peer_cfg(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);
|
subenum = ike_sa->create_child_sa_enumerator(ike_sa);
|
||||||
while (subenum->enumerate(subenum, &child_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->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);
|
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1737,7 +1737,8 @@ static void adopt_children_and_vips(ike_sa_t *old, ike_sa_t *new)
|
|||||||
host_t *vip;
|
host_t *vip;
|
||||||
int chcount = 0, vipcount = 0;
|
int chcount = 0, vipcount = 0;
|
||||||
|
|
||||||
|
charon->bus->children_migrate(charon->bus, new->get_id(new),
|
||||||
|
new->get_unique_id(new));
|
||||||
enumerator = old->create_child_sa_enumerator(old);
|
enumerator = old->create_child_sa_enumerator(old);
|
||||||
while (enumerator->enumerate(enumerator, &child_sa))
|
while (enumerator->enumerate(enumerator, &child_sa))
|
||||||
{
|
{
|
||||||
@@ -1760,6 +1761,7 @@ static void adopt_children_and_vips(ike_sa_t *old, ike_sa_t *new)
|
|||||||
/* ...trigger the analogous event on the new SA */
|
/* ...trigger the analogous event on the new SA */
|
||||||
charon->bus->set_sa(charon->bus, new);
|
charon->bus->set_sa(charon->bus, new);
|
||||||
charon->bus->assign_vips(charon->bus, new, TRUE);
|
charon->bus->assign_vips(charon->bus, new, TRUE);
|
||||||
|
charon->bus->children_migrate(charon->bus, NULL, 0);
|
||||||
charon->bus->set_sa(charon->bus, old);
|
charon->bus->set_sa(charon->bus, old);
|
||||||
|
|
||||||
if (chcount || vipcount)
|
if (chcount || vipcount)
|
||||||
|
|||||||
@@ -1475,6 +1475,8 @@ METHOD(task_manager_t, queue_ike_reauth, void,
|
|||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
|
|
||||||
|
charon->bus->children_migrate(charon->bus, new->get_id(new),
|
||||||
|
new->get_unique_id(new));
|
||||||
enumerator = this->ike_sa->create_child_sa_enumerator(this->ike_sa);
|
enumerator = this->ike_sa->create_child_sa_enumerator(this->ike_sa);
|
||||||
while (enumerator->enumerate(enumerator, &child_sa))
|
while (enumerator->enumerate(enumerator, &child_sa))
|
||||||
{
|
{
|
||||||
@@ -1482,6 +1484,9 @@ METHOD(task_manager_t, queue_ike_reauth, void,
|
|||||||
new->add_child_sa(new, child_sa);
|
new->add_child_sa(new, child_sa);
|
||||||
}
|
}
|
||||||
enumerator->destroy(enumerator);
|
enumerator->destroy(enumerator);
|
||||||
|
charon->bus->set_sa(charon->bus, new);
|
||||||
|
charon->bus->children_migrate(charon->bus, NULL, 0);
|
||||||
|
charon->bus->set_sa(charon->bus, this->ike_sa);
|
||||||
|
|
||||||
if (!new->get_child_count(new))
|
if (!new->get_child_count(new))
|
||||||
{ /* check if a Quick Mode task is queued (UNITY_LOAD_BALANCE case) */
|
{ /* check if a Quick Mode task is queued (UNITY_LOAD_BALANCE case) */
|
||||||
|
|||||||
Reference in New Issue
Block a user