From: Thomas Egerer Date: Mon, 16 Jan 2012 16:41:47 +0000 (+0100) Subject: Destroy active task list before queued tasks X-Git-Tag: 4.6.2~54 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d68b8dfec490c553c6a1fe3907d8bb590a1ba165;p=thirdparty%2Fstrongswan.git Destroy active task list before queued tasks Since active task's destruction might result in adopting tasks from a rekeyed ike sa it seems better to first destroy the active task list and then destroy all queued tasks. This way adoption is possible at all, while otherwise the queued task list would be empty. --- diff --git a/src/libcharon/sa/task_manager.c b/src/libcharon/sa/task_manager.c index 473bf34f13..dad533b316 100644 --- a/src/libcharon/sa/task_manager.c +++ b/src/libcharon/sa/task_manager.c @@ -159,15 +159,15 @@ struct private_task_manager_t { */ static void flush(private_task_manager_t *this) { - this->queued_tasks->destroy_offset(this->queued_tasks, - offsetof(task_t, destroy)); - this->queued_tasks = linked_list_create(); this->passive_tasks->destroy_offset(this->passive_tasks, offsetof(task_t, destroy)); this->passive_tasks = linked_list_create(); this->active_tasks->destroy_offset(this->active_tasks, offsetof(task_t, destroy)); this->active_tasks = linked_list_create(); + this->queued_tasks->destroy_offset(this->queued_tasks, + offsetof(task_t, destroy)); + this->queued_tasks = linked_list_create(); } /**