inactivity-job: Schedule job by CHILD_SA unique ID instead of reqid

This commit is contained in:
Martin Willi
2015-02-20 13:34:51 +01:00
parent 84e391e08e
commit 85ace154d8
4 changed files with 17 additions and 23 deletions
+3 -6
View File
@@ -206,8 +206,8 @@ static void schedule_inactivity_timeout(private_quick_mode_t *this)
close_ike = lib->settings->get_bool(lib->settings,
"%s.inactivity_close_ike", FALSE, lib->ns);
lib->scheduler->schedule_job(lib->scheduler, (job_t*)
inactivity_job_create(this->child_sa->get_reqid(this->child_sa),
timeout, close_ike), timeout);
inactivity_job_create(this->child_sa->get_unique_id(this->child_sa),
timeout, close_ike), timeout);
}
}
@@ -406,10 +406,7 @@ static bool install(private_quick_mode_t *this)
{
charon->bus->child_updown(charon->bus, this->child_sa, TRUE);
}
if (!this->rekey)
{
schedule_inactivity_timeout(this);
}
schedule_inactivity_timeout(this);
this->child_sa = NULL;
return TRUE;
}
+4 -7
View File
@@ -296,7 +296,7 @@ static bool allocate_spi(private_child_create_t *this)
*/
static void schedule_inactivity_timeout(private_child_create_t *this)
{
u_int32_t timeout;
u_int32_t timeout, id;
bool close_ike;
timeout = this->config->get_inactivity(this->config);
@@ -304,9 +304,9 @@ static void schedule_inactivity_timeout(private_child_create_t *this)
{
close_ike = lib->settings->get_bool(lib->settings,
"%s.inactivity_close_ike", FALSE, lib->ns);
id = this->child_sa->get_unique_id(this->child_sa);
lib->scheduler->schedule_job(lib->scheduler, (job_t*)
inactivity_job_create(this->child_sa->get_reqid(this->child_sa),
timeout, close_ike), timeout);
inactivity_job_create(id, timeout, close_ike), timeout);
}
}
@@ -693,10 +693,7 @@ static status_t select_and_install(private_child_create_t *this,
this->ike_sa->add_child_sa(this->ike_sa, this->child_sa);
this->established = TRUE;
if (!this->rekey)
{ /* a rekeyed SA uses the same reqid, no need for a new job */
schedule_inactivity_timeout(this);
}
schedule_inactivity_timeout(this);
my_ts = linked_list_create_from_enumerator(
this->child_sa->create_ts_enumerator(this->child_sa, TRUE));