diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2008-11-11 06:37:37 +0000 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2008-11-11 06:37:37 +0000 |
commit | d487b4b727ca423aeca2b047c8d28d28dea57b02 (patch) | |
tree | 6a706c07a47c0d8f42f76e301d8690e39f322f5d /src/charon/processing/jobs/migrate_job.c | |
parent | 91db979cdda4943ab6512dc309ebe1b07273e717 (diff) | |
download | strongswan-d487b4b727ca423aeca2b047c8d28d28dea57b02.tar.bz2 strongswan-d487b4b727ca423aeca2b047c8d28d28dea57b02.tar.xz |
preliminary support of Mobile IPv6
Diffstat (limited to 'src/charon/processing/jobs/migrate_job.c')
-rw-r--r-- | src/charon/processing/jobs/migrate_job.c | 84 |
1 files changed, 5 insertions, 79 deletions
diff --git a/src/charon/processing/jobs/migrate_job.c b/src/charon/processing/jobs/migrate_job.c index 100158a67..f9b1df26b 100644 --- a/src/charon/processing/jobs/migrate_job.c +++ b/src/charon/processing/jobs/migrate_job.c @@ -83,90 +83,16 @@ static void execute(private_migrate_job_t *this) ike_sa = charon->ike_sa_manager->checkout_by_id(charon->ike_sa_manager, this->reqid, TRUE); } - if (ike_sa == NULL) + if (ike_sa) { - enumerator_t *enumerator, *children; - peer_cfg_t *peer_cfg; - child_cfg_t *found_cfg = NULL; - - enumerator = charon->backends->create_peer_cfg_enumerator(charon->backends); - while (enumerator->enumerate(enumerator, (void**)&peer_cfg)) - { - child_cfg_t *child_cfg; - - if (peer_cfg->get_ike_version(peer_cfg) != 2) - { - continue; - } - - children = peer_cfg->create_child_cfg_enumerator(peer_cfg); - while (children->enumerate(children, &child_cfg)) - { - if (child_cfg->equal_traffic_selectors(child_cfg, TRUE, this->src_ts) && - child_cfg->equal_traffic_selectors(child_cfg, FALSE, this->dst_ts)) - { - found_cfg = child_cfg; - break; - } - } - children->destroy(children); - if (found_cfg) - { - break; - } - } - enumerator->destroy(enumerator); - - if (found_cfg == NULL) - { - DBG1(DBG_JOB, "no matching child config found for policy %R === %R", - this->src_ts, this->dst_ts); - destroy(this); - return; - } - DBG1(DBG_JOB, "found matching child config '%s' for policy %R === %R", - found_cfg->get_name(found_cfg), - this->src_ts, this->dst_ts); - - ike_sa = charon->ike_sa_manager->checkout_by_config(charon->ike_sa_manager, - peer_cfg); - if (ike_sa->get_peer_cfg(ike_sa) == NULL) - { - host_t *my_host, *other_host; - ike_cfg_t *ike_cfg; - - ike_sa->set_peer_cfg(ike_sa, peer_cfg); - ike_cfg = peer_cfg->get_ike_cfg(peer_cfg); - my_host = host_create_from_dns(ike_cfg->get_my_addr(ike_cfg), 0, 0); - other_host = host_create_from_dns(ike_cfg->get_other_addr(ike_cfg), 0, 0); - ike_sa->set_my_host(ike_sa, my_host); - ike_sa->set_other_host(ike_sa, other_host); - } - if (this->local) - { - ike_sa->set_my_host(ike_sa, this->local->clone(this->local)); - } - if (this->remote) - { - ike_sa->set_other_host(ike_sa, this->remote->clone(this->remote)); - } - /* add a CHILD_SA for 'found_cfg' with a policy that has already been - * installed in the kernel - */ + DBG2(DBG_JOB, "found CHILD_SA with reqid {%d}", this->reqid); + ike_sa->set_kmaddress(ike_sa, this->local, this->remote); + charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa); } else { - DBG1(DBG_JOB, "found CHILD_SA with reqid {%d}", this->reqid); - if (this->local) - { - ike_sa->set_my_host(ike_sa, this->local); - } - if (this->remote) - { - ike_sa->set_other_host(ike_sa, this->remote->clone(this->remote)); - } + DBG1(DBG_JOB, "no CHILD_SA found with reqid {%d}", this->reqid); } - charon->ike_sa_manager->checkin(charon->ike_sa_manager, ike_sa); destroy(this); } |