fix: usr: Fix RPZ race condition during a reconfiguration

With RPZ in use, `named` could terminate unexpectedly because of a race condition when a reconfiguration command was received using `rndc`. This has been fixed.

Closes #5146

Merge branch '5146-rpz-reconfig-bug-fix' into 'main'

See merge request isc-projects/bind9!10079
This commit is contained in:
Arаm Sаrgsyаn 2025-02-21 11:45:00 +00:00
commit 5ba811bea2

View file

@ -6535,14 +6535,13 @@ query_resume(query_ctx_t *qctx) {
/*
* Has response policy changed out from under us?
*/
if (qctx->rpz_st->rpz_ver != qctx->view->rpzs->rpz_ver) {
if (qctx->view->rpzs == NULL ||
qctx->rpz_st->rpz_ver != qctx->view->rpzs->rpz_ver)
{
ns_client_log(qctx->client, NS_LOGCATEGORY_CLIENT,
NS_LOGMODULE_QUERY, DNS_RPZ_INFO_LEVEL,
"query_resume: RPZ settings "
"out of date "
"(rpz_ver %d, expected %d)",
qctx->view->rpzs->rpz_ver,
qctx->rpz_st->rpz_ver);
"query_resume: RPZ settings out of date "
"after of a reconfiguration");
QUERY_ERROR(qctx, DNS_R_SERVFAIL);
return ns_query_done(qctx);
}