From 2e49bbcc49930c6fa6317415555f89fe31c19ef2 Mon Sep 17 00:00:00 2001 From: Afschin Hormozdiary Date: Wed, 10 Oct 2018 10:01:05 +0200 Subject: [PATCH] ikev1: Ensure DPD_ACK is sent in time If a lot of QUICK_MODE tasks are queued and the other side sends a DPD request, there is a good chance for timeouts. Observed this in cases where other side is quite slow in responding QUICK_MODE requests (e.g. Cisco ASA v8.x) and about 100 CHILD_SAs are to be spawned. Closes strongswan/strongswan#115. --- src/libcharon/sa/ikev1/task_manager_v1.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libcharon/sa/ikev1/task_manager_v1.c b/src/libcharon/sa/ikev1/task_manager_v1.c index 7a1e16baf..b1a870278 100644 --- a/src/libcharon/sa/ikev1/task_manager_v1.c +++ b/src/libcharon/sa/ikev1/task_manager_v1.c @@ -544,6 +544,12 @@ METHOD(task_manager_t, initiate, status_t, new_mid = TRUE; break; } + if (activate_task(this, TASK_ISAKMP_DPD)) + { + exchange = INFORMATIONAL_V1; + new_mid = TRUE; + break; + } if (!mode_config_expected(this) && activate_task(this, TASK_QUICK_MODE)) { @@ -557,12 +563,6 @@ METHOD(task_manager_t, initiate, status_t, new_mid = TRUE; break; } - if (activate_task(this, TASK_ISAKMP_DPD)) - { - exchange = INFORMATIONAL_V1; - new_mid = TRUE; - break; - } break; case IKE_REKEYING: if (activate_task(this, TASK_ISAKMP_DELETE))