completed migration of MIPv6 connections

This commit is contained in:
Andreas Steffen
2008-11-16 21:19:58 +00:00
parent ad60c249b6
commit 7a915d627d
5 changed files with 75 additions and 36 deletions
+30
View File
@@ -85,8 +85,38 @@ static void execute(private_migrate_job_t *this)
}
if (ike_sa)
{
iterator_t *children;
child_sa_t *child_sa;
host_t *host;
children = ike_sa->create_child_sa_iterator(ike_sa);
while (children->iterate(children, (void**)&child_sa))
{
if (child_sa->get_reqid(child_sa) == this->reqid)
{
break;
}
}
children->destroy(children);
DBG2(DBG_JOB, "found CHILD_SA with reqid {%d}", this->reqid);
ike_sa->set_kmaddress(ike_sa, this->local, this->remote);
host = this->local->clone(this->local);
host->set_port(host, IKEV2_UDP_PORT);
ike_sa->set_my_host(ike_sa, host);
host = this->remote->clone(this->remote);
host->set_port(host, IKEV2_UDP_PORT);
ike_sa->set_other_host(ike_sa, host);
if (child_sa->update_hosts(child_sa, this->local, this->remote,
ike_sa->get_virtual_ip(ike_sa, TRUE),
ike_sa->has_condition(ike_sa, COND_NAT_ANY)) == NOT_SUPPORTED)
{
ike_sa->rekey_child_sa(ike_sa, child_sa->get_protocol(child_sa),
child_sa->get_spi(child_sa, TRUE));
}
charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa);
}
else
+1
View File
@@ -51,6 +51,7 @@ struct migrate_job_t {
* @param reqid reqid of the CHILD_SA to acquire
* @param src_ts source traffic selector to be used in the policy
* @param dst_ts destination traffic selector to be used in the policy
* @param dir direction of the policy (in|out)
* @param local local host address to be used in the IKE_SA
* @param remote remote host address to be used in the IKE_SA
* @return migrate_job_t object