From: Colin Vidal Date: Mon, 10 Nov 2025 12:11:05 +0000 (+0100) Subject: set `reload_status` to fail before logging it X-Git-Tag: v9.21.16~47^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19cec37d5e6038552888de62ddc2779e3600f2d4;p=thirdparty%2Fbind9.git set `reload_status` to fail before logging it The `reload_status` is set to `NAMED_RELOAD_FAILED` after the log line is printed about this change. Update `reload_status` first, to avoid (unlikely) case where a test waiting for this log line would attempt a RNDC reload query but it would be processed by `named` before the status is updated. --- diff --git a/bin/named/server.c b/bin/named/server.c index 34abfc7fc61..4392760da17 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -9861,11 +9861,11 @@ loadconfig(named_server_t *server) { ISC_LOG_INFO, "reloading configuration succeeded"); } else { + atomic_store(&server->reload_status, NAMED_RELOAD_FAILED); isc_log_write(NAMED_LOGCATEGORY_GENERAL, NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR, "reloading configuration failed: %s", isc_result_totext(result)); - atomic_store(&server->reload_status, NAMED_RELOAD_FAILED); } return result;