From 1100fdba26336fc5a2ca69cdbbb7c38db403f87a Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 26 Nov 2013 14:54:32 +0100 Subject: [PATCH] ike: Reestablish IKE_SAs based on child-creating tasks only if they are recreating CHILD_SAs --- src/libcharon/sa/ike_sa.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/libcharon/sa/ike_sa.c b/src/libcharon/sa/ike_sa.c index 15298a9dd7..446a391e14 100644 --- a/src/libcharon/sa/ike_sa.c +++ b/src/libcharon/sa/ike_sa.c @@ -34,7 +34,9 @@ #include #include #include +#include #include +#include #ifdef ME #include @@ -1540,7 +1542,7 @@ METHOD(ike_sa_t, reauth, status_t, } /** - * Check if tasks to create CHILD_SAs are queued in the given queue + * Check if tasks to recreate CHILD_SAs are queued in the given queue */ static bool is_child_queued(private_ike_sa_t *this, task_queue_t queue) { @@ -1552,11 +1554,23 @@ static bool is_child_queued(private_ike_sa_t *this, task_queue_t queue) queue); while (enumerator->enumerate(enumerator, &task)) { - if (task->get_type(task) == TASK_CHILD_CREATE || - task->get_type(task) == TASK_QUICK_MODE) + if (task->get_type(task) == TASK_CHILD_CREATE) { - found = TRUE; - break; + child_create_t *create = (child_create_t*)task; + if (create->is_recreating(create)) + { + found = TRUE; + break; + } + } + if (task->get_type(task) == TASK_QUICK_MODE) + { + quick_mode_t *create = (quick_mode_t*)task; + if (create->is_recreating(create)) + { + found = TRUE; + break; + } } } enumerator->destroy(enumerator); -- 2.47.2