aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/queues/jobs/initiate_job.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/charon/queues/jobs/initiate_job.c')
-rw-r--r--src/charon/queues/jobs/initiate_job.c21
1 files changed, 3 insertions, 18 deletions
diff --git a/src/charon/queues/jobs/initiate_job.c b/src/charon/queues/jobs/initiate_job.c
index 8b943a3f1..af50663d6 100644
--- a/src/charon/queues/jobs/initiate_job.c
+++ b/src/charon/queues/jobs/initiate_job.c
@@ -45,11 +45,6 @@ struct private_initiate_job_t {
connection_t *connection;
/**
- * host to connect to, use NULL to use connections one
- */
- host_t *other;
-
- /**
* associated policy to initiate
*/
policy_t *policy;
@@ -70,19 +65,12 @@ static status_t execute(private_initiate_job_t *this)
{
ike_sa_t *ike_sa;
- ike_sa = charon->ike_sa_manager->checkout_by_id(charon->ike_sa_manager,
+ ike_sa = charon->ike_sa_manager->checkout_by_peer(charon->ike_sa_manager,
this->connection->get_my_host(this->connection),
this->connection->get_other_host(this->connection),
this->policy->get_my_id(this->policy),
this->policy->get_other_id(this->policy));
-
- if (this->other)
- {
- ike_sa->set_other_host(ike_sa, this->other->clone(this->other));
- }
-
- this->connection->get_ref(this->connection);
- this->policy->get_ref(this->policy);
+
if (ike_sa->initiate(ike_sa, this->connection, this->policy) != SUCCESS)
{
DBG1(DBG_JOB, "initiation failed, going to delete IKE_SA");
@@ -101,15 +89,13 @@ static void destroy(private_initiate_job_t *this)
{
this->connection->destroy(this->connection);
this->policy->destroy(this->policy);
- DESTROY_IF(this->other);
free(this);
}
/*
* Described in header
*/
-initiate_job_t *initiate_job_create(connection_t *connection, host_t *other,
- policy_t *policy)
+initiate_job_t *initiate_job_create(connection_t *connection, policy_t *policy)
{
private_initiate_job_t *this = malloc_thing(private_initiate_job_t);
@@ -121,7 +107,6 @@ initiate_job_t *initiate_job_create(connection_t *connection, host_t *other,
/* private variables */
this->connection = connection;
this->policy = policy;
- this->other = other;
return &this->public;
}