ikev2: Allow task to skip exchange by setting undefined exchange type
authorMartin Willi <martin@revosec.ch>
Tue, 4 Nov 2014 12:54:29 +0000 (13:54 +0100)
committerMartin Willi <martin@revosec.ch>
Fri, 20 Feb 2015 12:34:57 +0000 (13:34 +0100)
src/libcharon/sa/ikev2/task_manager_v2.c

index b558f42..613c729 100644 (file)
@@ -609,6 +609,11 @@ METHOD(task_manager_t, initiate, status_t,
 
        /* update exchange type if a task changed it */
        this->initiating.type = message->get_exchange_type(message);
+       if (this->initiating.type == EXCHANGE_TYPE_UNDEFINED)
+       {
+               message->destroy(message);
+               return SUCCESS;
+       }
 
        if (!generate_message(this, message, &this->initiating.packets))
        {