From: Tobias Brunner Date: Tue, 26 Nov 2013 13:54:32 +0000 (+0100) Subject: ike: Reestablish IKE_SAs based on child-creating tasks only if they are recreating... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Freestablish-childsas;p=thirdparty%2Fstrongswan.git ike: Reestablish IKE_SAs based on child-creating tasks only if they are recreating CHILD_SAs --- 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);