Cancel pending retransmits when flushing active task queue
authorMartin Willi <martin@revosec.ch>
Mon, 21 May 2012 12:53:40 +0000 (14:53 +0200)
committerMartin Willi <martin@revosec.ch>
Mon, 21 May 2012 12:57:33 +0000 (14:57 +0200)
src/libcharon/sa/ikev1/task_manager_v1.c

index b52a7e9..1639125 100644 (file)
@@ -227,6 +227,10 @@ METHOD(task_manager_t, flush_queue, void,
        {
                case TASK_QUEUE_ACTIVE:
                        list = this->active_tasks;
+                       /* cancel pending retransmits */
+                       this->initiating.type = EXCHANGE_TYPE_UNDEFINED;
+                       DESTROY_IF(this->initiating.packet);
+                       this->initiating.packet = NULL;
                        break;
                case TASK_QUEUE_PASSIVE:
                        list = this->passive_tasks;