Setting message ID on task manager sets DPD sequence numbers in IKEv1
authorMartin Willi <martin@revosec.ch>
Fri, 20 Jan 2012 11:22:56 +0000 (12:22 +0100)
committerMartin Willi <martin@revosec.ch>
Tue, 20 Mar 2012 16:31:38 +0000 (17:31 +0100)
src/libcharon/sa/ikev1/task_manager_v1.c
src/libcharon/sa/task_manager.h

index ac3824b..8ebaa9d 100755 (executable)
@@ -1393,6 +1393,14 @@ METHOD(task_manager_t, reset, void,
        this->initiating.seqnr = 0;
        this->initiating.retransmitted = 0;
        this->initiating.type = EXCHANGE_TYPE_UNDEFINED;
+       if (initiate != UINT_MAX)
+       {
+               this->dpd_send = initiate;
+       }
+       if (respond != UINT_MAX)
+       {
+               this->dpd_recv = respond;
+       }
 
        /* reset queued tasks */
        enumerator = this->queued_tasks->create_enumerator(this->queued_tasks);
index b49c9a9..cbebc0a 100644 (file)
@@ -229,9 +229,11 @@ struct task_manager_t {
         * resets the message IDs and resets all active tasks using the migrate()
         * method.
         * Use a value of UINT_MAX to keep the current message ID.
+        * For IKEv1, the arguments do not set the message ID, but the DPD sequence
+        * number counters.
         *
-        * @param initiate              message ID to initiate exchanges (send)
-        * @param respond               message ID to respond to exchanges (expect)
+        * @param initiate              message ID / DPD seq to initiate exchanges (send)
+        * @param respond               message ID / DPD seq to respond to exchanges (expect)
         */
        void (*reset) (task_manager_t *this, u_int32_t initiate, u_int32_t respond);