aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/sa/task_manager_v1.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2011-12-13 11:19:08 +0100
committerMartin Willi <martin@revosec.ch>2012-03-20 17:31:19 +0100
commit41fbde45442f2e33beebb4e0b6075a1d6a9ad948 (patch)
tree2926ee543e72af05b7adc13bcfbe0ef5bee123f4 /src/libcharon/sa/task_manager_v1.c
parent92aa6e0255aeb5951d73a405db662fe9fdc78700 (diff)
downloadstrongswan-41fbde45442f2e33beebb4e0b6075a1d6a9ad948.tar.bz2
strongswan-41fbde45442f2e33beebb4e0b6075a1d6a9ad948.tar.xz
Reset task manager state when build() completes an exchange (quick mode)
Diffstat (limited to 'src/libcharon/sa/task_manager_v1.c')
-rwxr-xr-xsrc/libcharon/sa/task_manager_v1.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libcharon/sa/task_manager_v1.c b/src/libcharon/sa/task_manager_v1.c
index 6a9592fe5..b292934bc 100755
--- a/src/libcharon/sa/task_manager_v1.c
+++ b/src/libcharon/sa/task_manager_v1.c
@@ -415,8 +415,10 @@ METHOD(task_manager_t, initiate, status_t,
}
enumerator->destroy(enumerator);
- /* update exchange type if a task changed it */
- this->initiating.type = message->get_exchange_type(message);
+ if (this->active_tasks->get_count(this->active_tasks) == 0)
+ { /* tasks completed, no exchange active anymore */
+ this->initiating.type = EXCHANGE_TYPE_UNDEFINED;
+ }
this->initiating.seqnr++;
status = this->ike_sa->generate_message(this->ike_sa, message,
@@ -442,7 +444,7 @@ METHOD(task_manager_t, initiate, status_t,
this->initiating.packet = NULL;
/* close after sending an INFORMATIONAL error but not yet established */
- if (this->initiating.type == INFORMATIONAL_V1 &&
+ if (exchange == INFORMATIONAL_V1 &&
this->ike_sa->get_state(this->ike_sa) == IKE_CONNECTING)
{
return FAILED;