ike-rekey: Make sure to ignore task when detecting collisions if ike-init subtask...
authorTobias Brunner <tobias@strongswan.org>
Wed, 1 Jun 2016 13:45:01 +0000 (15:45 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 17 Jun 2016 16:48:06 +0000 (18:48 +0200)
For instance, if INVALID_KE_PAYLOAD is returned we don't want this task
to affect any active rekeying (no new SA has been established so far).

src/libcharon/sa/ikev2/tasks/ike_rekey.c

index dadf872..44684bc 100644 (file)
@@ -242,9 +242,10 @@ METHOD(task_t, build_r, status_t,
                message->add_notify(message, TRUE, NO_PROPOSAL_CHOSEN, chunk_empty);
                return SUCCESS;
        }
                message->add_notify(message, TRUE, NO_PROPOSAL_CHOSEN, chunk_empty);
                return SUCCESS;
        }
-
        if (this->ike_init->task.build(&this->ike_init->task, message) == FAILED)
        {
        if (this->ike_init->task.build(&this->ike_init->task, message) == FAILED)
        {
+               this->ike_init->task.destroy(&this->ike_init->task);
+               this->ike_init = NULL;
                charon->bus->set_sa(charon->bus, this->ike_sa);
                return SUCCESS;
        }
                charon->bus->set_sa(charon->bus, this->ike_sa);
                return SUCCESS;
        }