]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
ike: Reestablish IKE_SAs based on child-creating tasks only if they are recreating... reestablish-childsas
authorTobias Brunner <tobias@strongswan.org>
Tue, 26 Nov 2013 13:54:32 +0000 (14:54 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 26 Nov 2013 14:31:48 +0000 (15:31 +0100)
src/libcharon/sa/ike_sa.c

index 15298a9dd7224baa86a1efc8bb7a0afa831f2794..446a391e149e531f5abc819f5b94d6f179c05433 100644 (file)
@@ -34,7 +34,9 @@
 #include <processing/jobs/send_keepalive_job.h>
 #include <processing/jobs/rekey_ike_sa_job.h>
 #include <processing/jobs/retry_initiate_job.h>
+#include <sa/ikev1/tasks/quick_mode.h>
 #include <sa/ikev2/tasks/ike_auth_lifetime.h>
+#include <sa/ikev2/tasks/child_create.h>
 
 #ifdef ME
 #include <sa/ikev2/tasks/ike_me.h>
@@ -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);