Compiler warning fixed.
[strongswan.git] / src / libcharon / sa / ikev1 / task_manager_v1.c
index 5695b4e..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;
                                }
@@ -1045,6 +1045,7 @@ METHOD(task_manager_t, process_message, status_t,
                 this->active_tasks->get_count(this->active_tasks)))
        {
                msg->set_request(msg, FALSE);
+               charon->bus->message(charon->bus, msg, TRUE, FALSE);
                status = parse_message(this, msg);
                if (status != SUCCESS)
                {
@@ -1053,7 +1054,7 @@ METHOD(task_manager_t, process_message, status_t,
                this->ike_sa->set_statistic(this->ike_sa, STAT_INBOUND,
                                                                        time_monotonic(NULL));
                this->ike_sa->update_hosts(this->ike_sa, me, other, TRUE);
-               charon->bus->message(charon->bus, msg, TRUE);
+               charon->bus->message(charon->bus, msg, TRUE, TRUE);
                if (process_response(this, msg) != SUCCESS)
                {
                        flush(this);
@@ -1110,6 +1111,7 @@ METHOD(task_manager_t, process_message, status_t,
                }
 
                msg->set_request(msg, TRUE);
+               charon->bus->message(charon->bus, msg, TRUE, FALSE);
                status = parse_message(this, msg);
                if (status != SUCCESS)
                {
@@ -1141,7 +1143,7 @@ METHOD(task_manager_t, process_message, status_t,
                                                "charon.half_open_timeout", HALF_OPEN_IKE_SA_TIMEOUT));
                }
                this->ike_sa->update_hosts(this->ike_sa, me, other, TRUE);
-               charon->bus->message(charon->bus, msg, TRUE);
+               charon->bus->message(charon->bus, msg, TRUE, TRUE);
                if (process_request(this, msg) != SUCCESS)
                {
                        flush(this);
@@ -1326,6 +1328,7 @@ METHOD(task_manager_t, queue_child_rekey, void,
                cfg = child_sa->get_config(child_sa);
                task = quick_mode_create(this->ike_sa, cfg->get_ref(cfg), NULL, NULL);
                task->use_reqid(task, child_sa->get_reqid(child_sa));
+               task->rekey(task, child_sa->get_spi(child_sa, TRUE));
 
                queue_task(this, &task->task);
        }
@@ -1390,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);
@@ -1471,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(),