Compiler warning fixed.
[strongswan.git] / src / libcharon / sa / ikev1 / task_manager_v1.c
index ac3824b..1c9b43a 100755 (executable)
@@ -485,8 +485,8 @@ METHOD(task_manager_t, initiate, status_t,
                        case SUCCESS:
                                /* task completed, remove it */
                                this->active_tasks->remove_at(this->active_tasks, enumerator);
-                               if (task->get_type(task) == AGGRESSIVE ||
-                                       task->get_type(task) == QUICK_MODE)
+                               if (task->get_type(task) == TASK_AGGRESSIVE_MODE ||
+                                       task->get_type(task) == TASK_QUICK_MODE)
                                {       /* last message of three message exchange */
                                        keep = TRUE;
                                }
@@ -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);
@@ -1474,9 +1482,13 @@ task_manager_v1_t *task_manager_v1_create(ike_sa_t *ike_sa)
                                .destroy = _destroy,
                        },
                },
+               .initiating = {
+                       .type = EXCHANGE_TYPE_UNDEFINED,
+               },
+               .responding = {
+                       .seqnr = RESPONDING_SEQ,
+               },
                .ike_sa = ike_sa,
-               .initiating.type = EXCHANGE_TYPE_UNDEFINED,
-               .responding.seqnr = RESPONDING_SEQ,
                .rng = lib->crypto->create_rng(lib->crypto, RNG_WEAK),
                .queued_tasks = linked_list_create(),
                .active_tasks = linked_list_create(),