fix: nil: Do not log no root hints of _bind chaos view

The "no root hints for view X" message must not be shown for the default
_bind/CH view. However, it is shown since 27c4f68dcc (part of effective
configuration changes).

The reason is that since 27c4f68dcc, `configure_views()` now processes
a single list of views, which contains both builtin and user views as
they are both part of the effective configuration. The changes omit the
(now removed, since 6b5f714e53) `need_hints` bool that was disabling the
warning for the builtin view (_bind/CH).

This disable that log again when configuring _bind/CH view.

Merge branch 'colin/nohintswarn-bindchaos' into 'main'

See merge request isc-projects/bind9!11264
This commit is contained in:
Colin Vidal 2025-11-22 04:51:30 +01:00
commit 376313c8dc
3 changed files with 63 additions and 1 deletions

View file

@ -4652,7 +4652,9 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist, cfg_obj_t *config,
&rootzone);
if (rootzone != NULL) {
dns_zone_detach(&rootzone);
} else {
} else if (strcmp(view->name, "_bind") != 0 ||
view->rdclass != dns_rdataclass_chaos)
{
isc_log_write(NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_WARNING,
"no root hints for view '%s'",

View file

@ -0,0 +1,35 @@
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* SPDX-License-Identifier: MPL-2.0
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
*/
options {
port @PORT@;
pid-file "named.pid";
listen-on { 10.53.0.1; };
};
key rndc_key {
secret "1234abcd8765";
algorithm @DEFAULT_HMAC@;
};
controls {
inet 10.53.0.1 port @CONTROLPORT@ allow { any; } keys { rndc_key; };
};
view _bind {
};
view foo {
};
view bar ch {
};

View file

@ -0,0 +1,25 @@
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
#
# SPDX-License-Identifier: MPL-2.0
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
import isctest
def test_nohintswarn_bindchaos(ns1):
found = True
try:
with ns1.watch_log_from_start(timeout=1) as watcher:
watcher.wait_for_line("no root hints for view '_bind'")
except isctest.log.watchlog.WatchLogTimeout:
found = False
assert found is False
with ns1.watch_log_from_start() as watcher:
watcher.wait_for_line("no root hints for view 'bar'")