From 1331010aa430c2622ee338ea2cea6f29f101ac3d Mon Sep 17 00:00:00 2001 From: Markus Sattler Date: Tue, 5 Jun 2018 08:20:52 +0200 Subject: [PATCH] starter: Reset action before handling it Stater will lose update/reload commands when there is a second signal coming in when the previous is still processed. This can happen more easily with big configurations. Closes strongswan/strongswan#101. --- src/starter/starter.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/starter/starter.c b/src/starter/starter.c index 8ca1af29c..5038429bd 100644 --- a/src/starter/starter.c +++ b/src/starter/starter.c @@ -650,6 +650,7 @@ int main (int argc, char **argv) */ if (_action_ & FLAG_ACTION_RELOAD) { + _action_ &= ~FLAG_ACTION_RELOAD; if (starter_charon_pid()) { for (conn = cfg->conn_first; conn; conn = conn->next) @@ -679,7 +680,6 @@ int main (int argc, char **argv) } } } - _action_ &= ~FLAG_ACTION_RELOAD; } /* @@ -687,6 +687,7 @@ int main (int argc, char **argv) */ if (_action_ & FLAG_ACTION_UPDATE) { + _action_ &= ~FLAG_ACTION_UPDATE; DBG2(DBG_APP, "Reloading config..."); new_cfg = confread_load(config_file); @@ -767,7 +768,6 @@ int main (int argc, char **argv) confread_free(new_cfg); } } - _action_ &= ~FLAG_ACTION_UPDATE; last_reload = time_monotonic(NULL); } @@ -776,6 +776,7 @@ int main (int argc, char **argv) */ if (_action_ & FLAG_ACTION_START_CHARON) { + _action_ &= ~FLAG_ACTION_START_CHARON; if (!starter_charon_pid()) { DBG2(DBG_APP, "Attempting to start %s...", daemon_name); @@ -786,7 +787,6 @@ int main (int argc, char **argv) } starter_stroke_configure(cfg); } - _action_ &= ~FLAG_ACTION_START_CHARON; for (ca = cfg->ca_first; ca; ca = ca->next) {