]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
set `reload_status` to fail before logging it
authorColin Vidal <colin@isc.org>
Mon, 10 Nov 2025 12:11:05 +0000 (13:11 +0100)
committerColin Vidal <colin@isc.org>
Tue, 18 Nov 2025 11:16:14 +0000 (12:16 +0100)
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.

bin/named/server.c

index 34abfc7fc61cfafbac064300aff55e1c97ac83ee..4392760da1708783f0fc2a92d1b5886bbb8804d5 100644 (file)
@@ -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;