]> git.ipfire.org Git - people/ms/strongswan.git/blobdiff - src/libcharon/sa/ikev2/task_manager_v2.c
Merge branch 'ikev1-clean' into ikev1-master
[people/ms/strongswan.git] / src / libcharon / sa / ikev2 / task_manager_v2.c
index d12f5c977bb57da9ca24a0c6f98bfcb86e3a09c4..ba7fdd2da6f095593bc1034512bab312f1520a5b 100644 (file)
@@ -162,15 +162,15 @@ struct private_task_manager_t {
  */
 static void flush(private_task_manager_t *this)
 {
-       this->queued_tasks->destroy_offset(this->queued_tasks,
-                                                                               offsetof(task_t, destroy));
-       this->queued_tasks = linked_list_create();
        this->passive_tasks->destroy_offset(this->passive_tasks,
                                                                                offsetof(task_t, destroy));
        this->passive_tasks = linked_list_create();
        this->active_tasks->destroy_offset(this->active_tasks,
                                                                                offsetof(task_t, destroy));
        this->active_tasks = linked_list_create();
+       this->queued_tasks->destroy_offset(this->queued_tasks,
+                                                                               offsetof(task_t, destroy));
+       this->queued_tasks = linked_list_create();
 }
 
 /**
@@ -369,6 +369,11 @@ METHOD(task_manager_t, initiate, status_t,
                                        exchange = INFORMATIONAL;
                                        break;
                                }
+                               if (activate_task(this, TASK_IKE_AUTH_LIFETIME))
+                               {
+                                       exchange = INFORMATIONAL;
+                                       break;
+                               }
 #ifdef ME
                                if (activate_task(this, TASK_IKE_ME))
                                {
@@ -640,11 +645,9 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
                                                                                                   enumerator);
                                }
                                break;
+                       case DESTROY_ME:
                        case FAILED:
                        default:
-                               charon->bus->ike_updown(charon->bus, this->ike_sa, FALSE);
-                               /* FALL */
-                       case DESTROY_ME:
                                /* destroy IKE_SA, but SEND response first */
                                delete = TRUE;
                                break;
@@ -679,6 +682,7 @@ static status_t build_response(private_task_manager_t *this, message_t *request)
                                                 this->responding.packet->clone(this->responding.packet));
        if (delete)
        {
+               charon->bus->ike_updown(charon->bus, this->ike_sa, FALSE);
                return DESTROY_ME;
        }
        return SUCCESS;