diff options
author | Tobias Brunner <tobias@strongswan.org> | 2014-07-22 18:51:57 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2014-09-12 10:29:36 +0200 |
commit | 3293d146289d7c05e6c6089ae1f7cdbcea378e63 (patch) | |
tree | d74044235a0bb648ea1b5bda09f6376d26efbd89 /src | |
parent | 40164bbe27576c68a6dc052a52f918a13d6d65e5 (diff) | |
download | strongswan-3293d146289d7c05e6c6089ae1f7cdbcea378e63.tar.bz2 strongswan-3293d146289d7c05e6c6089ae1f7cdbcea378e63.tar.xz |
ikev2: Insert MOBIKE tasks at the front of the queue
In case we have no usable path to the other peer there is no point in
initiating any other tasks (like rekeying).
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/sa/ikev2/task_manager_v2.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libcharon/sa/ikev2/task_manager_v2.c b/src/libcharon/sa/ikev2/task_manager_v2.c index ada798bdc..630c902f4 100644 --- a/src/libcharon/sa/ikev2/task_manager_v2.c +++ b/src/libcharon/sa/ikev2/task_manager_v2.c @@ -1246,6 +1246,8 @@ METHOD(task_manager_t, process_message, status_t, METHOD(task_manager_t, queue_task, void, private_task_manager_t *this, task_t *task) { + int pos = ARRAY_TAIL; + if (task->get_type(task) == TASK_IKE_MOBIKE) { /* there is no need to queue more than one mobike task */ enumerator_t *enumerator; @@ -1262,9 +1264,12 @@ METHOD(task_manager_t, queue_task, void, } } enumerator->destroy(enumerator); + /* insert MOBIKE tasks first as we currently might not have a usable + * path to initiate any other tasks */ + pos = ARRAY_HEAD; } DBG2(DBG_IKE, "queueing %N task", task_type_names, task->get_type(task)); - array_insert(this->queued_tasks, ARRAY_TAIL, task); + array_insert(this->queued_tasks, pos, task); } /** |