Use IKEv1 specific tasks to close Quick Mode SAs
authorMartin Willi <martin@revosec.ch>
Wed, 14 Dec 2011 15:39:44 +0000 (16:39 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:22 +0000 (17:31 +0100)
src/libcharon/sa/ike_sa.c
src/libcharon/sa/task_manager_v1.c
src/libcharon/sa/tasks/informational.c

index fa07f58..7b4d16c 100644 (file)
@@ -48,6 +48,7 @@
 #include <sa/tasks/child_rekey.h>
 #include <sa/tasks/main_mode.h>
 #include <sa/tasks/quick_mode.h>
+#include <sa/tasks/quick_delete.h>
 #include <sa/tasks/ike_natd_v1.h>
 #include <sa/tasks/ike_vendor_v1.h>
 #include <sa/tasks/isakmp_delete.h>
@@ -1341,10 +1342,17 @@ METHOD(ike_sa_t, rekey_child_sa, status_t,
 METHOD(ike_sa_t, delete_child_sa, status_t,
        private_ike_sa_t *this, protocol_id_t protocol, u_int32_t spi)
 {
-       child_delete_t *child_delete;
+       task_t *task;
 
-       child_delete = child_delete_create(&this->public, protocol, spi);
-       this->task_manager->queue_task(this->task_manager, &child_delete->task);
+       if (this->version == IKEV1)
+       {
+               task = (task_t*)quick_delete_create(&this->public, protocol, spi);
+       }
+       else
+       {
+               task = (task_t*)child_delete_create(&this->public, protocol, spi);
+       }
+       this->task_manager->queue_task(this->task_manager, task);
        return this->task_manager->initiate(this->task_manager);
 }
 
index 494fe84..2f90551 100755 (executable)
@@ -339,7 +339,7 @@ METHOD(task_manager_t, initiate, status_t,
                                        exchange = INFORMATIONAL_V1;
                                        new_mid = TRUE;
                                }
-                               if (activate_task(this, TASK_CHILD_DELETE))
+                               if (activate_task(this, TASK_QUICK_DELETE))
                                {
                                        exchange = INFORMATIONAL_V1;
                                        new_mid = TRUE;
index 5391dd3..f0ddad0 100644 (file)
@@ -17,7 +17,7 @@
 
 #include <daemon.h>
 #include <sa/tasks/isakmp_delete.h>
-#include <sa/tasks/child_delete.h>
+#include <sa/tasks/quick_delete.h>
 #include <encoding/payloads/delete_payload.h>
 
 typedef struct private_informational_t private_informational_t;
@@ -104,7 +104,7 @@ METHOD(task_t, process_r, status_t,
                                        }
                                        else
                                        {
-                                               this->del = (task_t*)child_delete_create(this->ike_sa,
+                                               this->del = (task_t*)quick_delete_create(this->ike_sa,
                                                                                                                                 PROTO_NONE, 0);
                                        }
                                }