ikev1: Ensure DPD_ACK is sent in time
[strongswan.git] / src / libcharon / sa / ikev1 / task_manager_v1.c
index 7a1e16b..b1a8702 100644 (file)
@@ -544,20 +544,20 @@ METHOD(task_manager_t, initiate, status_t,
                                        new_mid = TRUE;
                                        break;
                                }
-                               if (!mode_config_expected(this) &&
-                                       activate_task(this, TASK_QUICK_MODE))
+                               if (activate_task(this, TASK_ISAKMP_DPD))
                                {
-                                       exchange = QUICK_MODE;
+                                       exchange = INFORMATIONAL_V1;
                                        new_mid = TRUE;
                                        break;
                                }
-                               if (activate_task(this, TASK_INFORMATIONAL))
+                               if (!mode_config_expected(this) &&
+                                       activate_task(this, TASK_QUICK_MODE))
                                {
-                                       exchange = INFORMATIONAL_V1;
+                                       exchange = QUICK_MODE;
                                        new_mid = TRUE;
                                        break;
                                }
-                               if (activate_task(this, TASK_ISAKMP_DPD))
+                               if (activate_task(this, TASK_INFORMATIONAL))
                                {
                                        exchange = INFORMATIONAL_V1;
                                        new_mid = TRUE;