]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 months agoLock the catalog zone when reconfiguring it
Aram Sargsyan [Fri, 5 Dec 2025 10:06:28 +0000 (10:06 +0000)] 
Lock the catalog zone when reconfiguring it

A catalog zone is updated in an offloaded thread, which is not
stopped during a reconfiguration in an exclusive mode, and so
can cause a race condition with it.

Waiting for the offloaded threads to complete their work before
entering into the exclusive mode can potentially cause unwanted
delays, because offloaded threads are generally "allowed" to take
a longer amount of time before they complete.

Add a dns_catz_zone_prereconfig()/dns_catz_zone_postreconfig() pair
of functions which currently just lock the catalog zone when
reconfiguring it. The change should eliminate the race.

As a side note, there was already a similar pair of functions,
dns_catz_prereconfig() and dns_catz_postreconfig() which are called
before and after reconfiguring a 'dns_catz_zones_t' object.

Below are the stack traces of the reconfiguration thread which has
asserted, and a catalog zone update thread which was caught in the
middle of its work despite the fact that the exclusive mode is
turned on.

                Stack trace of thread 23859:
                #0  0x00007f80e7b8e52f raise (libc.so.6)
                #1  0x00007f80e7b61e65 abort (libc.so.6)
                #2  0x0000000000422558 assertion_failed (named)
                #3  0x00007f80eaa6799e isc_assertion_failed (libisc-9.18.41.so)
                #4  0x00007f80ea5bc788 dns_catz_entry_getname (libdns-9.18.41.so)
                #5  0x000000000042ce0e catz_reconfigure (named)
                #6  0x000000000042d3c5 configure_catz_zone (named)
                #7  0x000000000042d7a4 configure_catz (named)
                #8  0x0000000000430645 configure_view (named)
                #9  0x000000000043d998 load_configuration (named)
                #10 0x000000000044184f loadconfig (named)
                #11 0x0000000000442525 named_server_reconfigcommand (named)
                #12 0x000000000041b277 named_control_docommand (named)
                #13 0x000000000041c74a control_command (named)
                #14 0x00007f80eaa912ae task_run (libisc-9.18.41.so)
                #15 0x00007f80eaa914cd isc_task_run (libisc-9.18.41.so)
                #16 0x00007f80eaa46435 isc__nm_async_task (libisc-9.18.41.so)
                #17 0x00007f80eaa467aa process_netievent (libisc-9.18.41.so)
                #18 0x00007f80eaa475a6 process_queue (libisc-9.18.41.so)
                #19 0x00007f80eaa46227 process_all_queues (libisc-9.18.41.so)
                #20 0x00007f80eaa462a1 async_cb (libisc-9.18.41.so)
                #21 0x00007f80e8d01893 uv__async_io.part.3 (libuv.so.1)
                #22 0x00007f80e8d13ac4 uv__io_poll (libuv.so.1)
                #23 0x00007f80e8d023fb uv_run (libuv.so.1)
                #24 0x00007f80eaa45ced nm_thread (libisc-9.18.41.so)
                #25 0x00007f80eaa9bda3 isc__trampoline_run (libisc-9.18.41.so)
                #26 0x00007f80e7f1e1ca start_thread (libpthread.so.0)
                #27 0x00007f80e7b798d3 __clone (libc.so.6)
    ...
    ...
                Stack trace of thread 23912:
                #0  0x00007f80ea5bc2da dns_catz_options_setdefault (libdns-9.18.41.so)
                #1  0x00007f80ea5bd411 dns__catz_zones_merge (libdns-9.18.41.so)
                #2  0x00007f80ea5c3c2f dns__catz_update_cb (libdns-9.18.41.so)
                #3  0x00007f80eaa4fee9 isc__nm_work_run (libisc-9.18.41.so)
                #4  0x00007f80eaa9bda3 isc__trampoline_run (libisc-9.18.41.so)
                #5  0x00007f80eaa4ff48 isc__nm_work_cb (libisc-9.18.41.so)
                #6  0x00007f80e8cfc75e worker (libuv.so.1)
                #7  0x00007f80e7f1e1ca start_thread (libpthread.so.0)
                #8  0x00007f80e7b798d3 __clone (libc.so.6)

5 months agochg: nil: Add dns_rdataset_cleanup() function to conditionally cleanup rdatasets
Ondřej Surý [Wed, 17 Dec 2025 14:20:14 +0000 (15:20 +0100)] 
chg: nil: Add dns_rdataset_cleanup() function to conditionally cleanup rdatasets

Merge branch 'ondrej/add-dns_rdataset_cleanup' into 'main'

See merge request isc-projects/bind9!11382

5 months agoCleanup the extra dns_rdataset_disassociate() code
Ondřej Surý [Wed, 17 Dec 2025 07:38:34 +0000 (08:38 +0100)] 
Cleanup the extra dns_rdataset_disassociate() code

Manually go through the code using dns_rdataset_isassociated() and
use dns_rdataset_cleanup() where appropriate in places that a simple
semantic patch is not able to find automatically.

5 months agoApply the dns_rdataset_cleanup patch through the codebase
Ondřej Surý [Wed, 17 Dec 2025 06:09:15 +0000 (07:09 +0100)] 
Apply the dns_rdataset_cleanup patch through the codebase

Add a semantic patch to turn the conditional rdataset disassociate into
dns_rdataset_cleanup() call and run it.

5 months agoAdd dns_rdataset_cleanup() that conditionally disassociate rdataset
Ondřej Surý [Wed, 17 Dec 2025 05:59:33 +0000 (06:59 +0100)] 
Add dns_rdataset_cleanup() that conditionally disassociate rdataset

We had a common pattern in the code that looks like this:

if (dns_rdataset_isassociated(rdataset)) {
dns_rdataset_disassociate(rdataset);
}

add a helper macro that checks for rdataset != NULL and the above
called dns_rdataset_cleanup(rdataset).

5 months agonew: ci: Add a tag pipeline CI job to update the stable tag after a release
Andoni Duarte [Wed, 17 Dec 2025 11:37:44 +0000 (11:37 +0000)] 
new: ci: Add a tag pipeline CI job to update the stable tag after a release

Add a tag pipeline CI job to update the stable tag after a release.

Merge branch 'andoni/add-ci-job-to-update-stable-tag-in-a-release' into 'main'

See merge request isc-projects/bind9!11291

5 months agoAdd a tag pipeline CI job to update the stable tag after a release
Andoni Duarte Pintado [Thu, 27 Nov 2025 11:45:30 +0000 (12:45 +0100)] 
Add a tag pipeline CI job to update the stable tag after a release

Introduce a CI job to update the "stable" tag with the latest released
stable version tag. This is a manual job that only runs in tag
pipelines in the context of a release.

5 months agonew: usr: Add support for Extended DNS Error 9 (Missing DNSKEY)
Colin Vidal [Wed, 17 Dec 2025 09:18:53 +0000 (10:18 +0100)] 
new: usr: Add support for Extended DNS Error 9 (Missing DNSKEY)

Extended DNS Error 9 (Missing DNSKEY) is now sent when a validating resolver attempts to validate a response but can't get the DNSKEY from the authoritative server of the zone, while the DS record is present in the parent zone.

See #2715

Merge branch '2715-missingdnskey' into 'main'

See merge request isc-projects/bind9!10296

5 months agoupdate SERVFAIL cache test
Colin Vidal [Tue, 16 Dec 2025 18:33:50 +0000 (19:33 +0100)] 
update SERVFAIL cache test

An existing SERVFAIL cache test is updated as it initially checks there
are no EDE (the first SERVFAIL) then immediately re-does the same query,
(still SERVFAIL), and expect the CACHED_ERROR EDE.

However, the configuration used for this test to generate a SERVFAIL is
a broken DNSSEC configuration, where the DNSKEY is not the expected one
(it's a ZSK instead of a KZK). As a result, the first attempt also now
raise an EDE (MISSING_DNSKEY).

5 months agoadd system tests covering EDE 9
Colin Vidal [Wed, 3 Dec 2025 13:22:43 +0000 (14:22 +0100)] 
add system tests covering EDE 9

The authoritative server on "missing-dnskey." zone is ns2, the zone is
initially signed normally, but then the DNSKEY are pulled out from the
signed generated zone file. As a consequence, a quering the resolver ns4
returns a SERVFAIL with EDE9 as the chain of trust is broken: the DS is
prsent in the parent zone (the root zone in ns1), but the DNSKEY is
missing from the zone.

A similar is "wrong-dnskey.", but here the zone is signed correctly,
but the DS points to a different DNSKEY. Hence no supported matching
DNSKEY record could be found for the child.

5 months agoadd support for EDE 9
Colin Vidal [Wed, 3 Dec 2025 13:20:20 +0000 (14:20 +0100)] 
add support for EDE 9

Extended DNS Error 9 (Missing DNSKEY) is now sent when a validating resolver
attempts to validate a response but can't get the DNSKEY from the authoritative
server of the zone, while the DS record is present in the parent zone.

Note the EDE 9 is send as part of the proveunsecure flow, after the
validator successfully fetched the DS of the zone from the parent. So if
the DS is also missing, the EDE 9 won't be sent.

5 months agochg: test: Temporarily change pytest.PytestRemovedIn9Warning error to warning
Michal Nowak [Tue, 16 Dec 2025 20:25:37 +0000 (21:25 +0100)] 
chg: test: Temporarily change pytest.PytestRemovedIn9Warning error to warning

We need this to be able to use pytest 9.0 from Debian "sid".

Additionally, this error needs to be addressed before pytest 9.1 is
released, as the filter will no longer work. Also, all pytests in CI
images need to be upgraded to version 7, where the new API is supported.

Related #5690

Merge branch 'mnowak/ignore-pytest-PytestRemovedIn9Warning' into 'main'

See merge request isc-projects/bind9!11379

5 months agoTemporarily change pytest.PytestRemovedIn9Warning error to warning
Michal Nowak [Tue, 16 Dec 2025 18:03:38 +0000 (19:03 +0100)] 
Temporarily change pytest.PytestRemovedIn9Warning error to warning

We need this to be able to use pytest 9.0 from Debian "sid".

Additionally, this error needs to be addressed before pytest 9.1 is
released, as the filter will no longer work. Also, all pytests in CI
images need to be upgraded to version 7, where the new API is supported.

We can't have the "filterwarnings" section in pytest.ini directly as
only pytest 8.0 knows about it.

5 months agofix: dev: Copy only raw data when we are copying dns_slab{header,vec}
Ondřej Surý [Tue, 16 Dec 2025 17:09:21 +0000 (18:09 +0100)] 
fix: dev: Copy only raw data when we are copying dns_slab{header,vec}

Fix the data race between reading source slabheader in `makeslab()`
and the heap (write) operation on the same header in the QPcache.

Closes #5627

Merge branch '5688-prevent-data-race-when-copying-slabheader-and-slabvecs' into 'main'

See merge request isc-projects/bind9!11375

5 months agoCopy only the raw data when we are copying dns_slab{header,vec}
Ondřej Surý [Tue, 16 Dec 2025 10:11:05 +0000 (11:11 +0100)] 
Copy only the raw data when we are copying dns_slab{header,vec}

The makeslab function in rdataslab.c contains an optimization for cases
where the source is already an rdataslab. In these cases, it copies the
entire slab using memmove.  However, this creates a race condition: while
the target slab is protected by a node lock, the source slab is not
protected.  This becomes problematic because the TTL heap needs to
modify the heap index stored in the slab header, potentially while the
memmove operation is reading from it.

A closer look at makeslab shows that copying the header part of the slab
is unnecessary, the header can be default-initialized instead. This MR
modifies makeslab to copy only the raw part of the slab, while
default-initializing the header, eliminating the race condition.  For
consistency, it also applies the same change to vecheader/makevec.

5 months agofix: dev: Unpack struct vecheader
Alessio Podda [Tue, 16 Dec 2025 17:06:12 +0000 (17:06 +0000)] 
fix: dev: Unpack struct vecheader

The bitset packing of the resign_lsb and heap_index in struct vecheader was causing a race condition, since both bindrdataset and heap operations tried to access the same byte (even though they are accessing different fields).

While heap operations are protected by the node lock of the header being inserted, they aren't protected by the node locks of the headers being displaced, leading to the race condition.

This MR fixes the issue by reverting the struct packing optimization.

Closes #5688

Merge branch '5688-no-heap-index-bitset' into 'main'

See merge request isc-projects/bind9!11378

5 months agoUnpack struct vecheader
Alessio Podda [Tue, 16 Dec 2025 14:39:45 +0000 (15:39 +0100)] 
Unpack struct vecheader

The bitset packing of the resign_lsb and heap_index in struct vecheader
was causing a race condition, since both bindrdataset and heap
operations tried to access the same byte (even though they are accessing
different fields).

While heap operations are protected by the node lock of the header being
inserted, they aren't protected by the node locks of the headers being
displaced, leading to the race condition.

This commit fixes the issue by reverting the struct packing
optimization.

5 months agoRename rdatavec flags
Alessio Podda [Tue, 16 Dec 2025 14:39:17 +0000 (15:39 +0100)] 
Rename rdatavec flags

Qpzone was still using the RDATASLAB constants, instead of the RDATAVEC
ones. While both have the same definition, using the RDATAVEC ones is
correct.

5 months agofix: test: Exclude f.f.f.f.ip6.arpa names from test_sythreverse_refused_v6
Mark Andrews [Tue, 16 Dec 2025 11:04:58 +0000 (22:04 +1100)] 
fix: test: Exclude f.f.f.f.ip6.arpa names from test_sythreverse_refused_v6

f.f.f.f.ip6.arpa is a configured zone so refused responses
are not expected.

Closes #5687

Merge branch '5687-synthrecord-test-failed' into 'main'

See merge request isc-projects/bind9!11373

5 months agoExclude f.f.f.f.ip6.arpa names from test_sythreverse_refused_v6
Mark Andrews [Tue, 16 Dec 2025 02:00:07 +0000 (13:00 +1100)] 
Exclude f.f.f.f.ip6.arpa names from test_sythreverse_refused_v6

f.f.f.f.ip6.arpa is a configured zone so refused responses
are not expected.

5 months agofix: nil: protoc-c is deprecated, use protoc if available over proto-c
Mark Andrews [Tue, 16 Dec 2025 00:54:54 +0000 (11:54 +1100)] 
fix: nil: protoc-c is deprecated, use protoc if available over proto-c

Closes #5684

Merge branch '5684-protoc-c-is-deprecated' into 'main'

See merge request isc-projects/bind9!11369

5 months agoproto-c is deprecated, use protoc if available over proto-c
Mark Andrews [Mon, 15 Dec 2025 04:32:38 +0000 (15:32 +1100)] 
proto-c is deprecated, use protoc if available over proto-c

5 months agochg: ci: Add TSAN report and core file globs to expected artifacts
Michal Nowak [Mon, 15 Dec 2025 19:25:09 +0000 (20:25 +0100)] 
chg: ci: Add TSAN report and core file globs to expected artifacts

Merge branch 'mnowak/add-tsan-reports-glob-to-expected-artifacts' into 'main'

See merge request isc-projects/bind9!11370

5 months agoAdd TSAN report and core file globs to expected artifacts
Michal Nowak [Mon, 15 Dec 2025 12:11:35 +0000 (13:11 +0100)] 
Add TSAN report and core file globs to expected artifacts

5 months agochg: test: Check delegation response to ANY query
Evan Hunt [Thu, 11 Dec 2025 19:57:12 +0000 (19:57 +0000)] 
chg: test: Check delegation response to ANY query

If mandatory glue is present, it should be returned when the query type is ANY.

Merge branch '5659-any-glue-test' into 'main'

See merge request isc-projects/bind9!11367

5 months agoCheck delegation response to ANY query
Evan Hunt [Thu, 11 Dec 2025 18:41:05 +0000 (10:41 -0800)] 
Check delegation response to ANY query

If mandatory glue is present, it should be returned when the query
type is ANY.

5 months agofix: usr: Fix the charts in the statistics channel
Arаm Sаrgsyаn [Wed, 10 Dec 2025 17:30:50 +0000 (17:30 +0000)] 
fix: usr: Fix the charts in the statistics channel

The charts in the statistics channel could sometimes fail
to render in the browser, and were completely disabled for
Mozilla-based browsers for historical reasons. This has
been fixed.

Merge branch 'aram/stats-channel-charts-fix' into 'main'

See merge request isc-projects/bind9!11018

5 months agoFix the charts in the statistics channel
Aram Sargsyan [Fri, 26 Sep 2025 12:51:37 +0000 (12:51 +0000)] 
Fix the charts in the statistics channel

The statistics channel's HTML presentation has charts, but it has
a couple of problems.

1. Because of an inconsistent condition, a chart's JS code might have
   been executed, while the HTML markup wasn't present, and this is
   causing a JS error.
2. The feature is turned off on Mozilla-based browsers.

Fix the inconsistency in conditions, remove the conditional rendering
which disabled the feature for Mozilla-based browsers by looking at
the XSLT processor's name, and fix indentation inconsistencies.

5 months agochg: nil: Log serial when IXFR version not in journal
Matthijs Mekking [Wed, 10 Dec 2025 15:24:41 +0000 (15:24 +0000)] 
chg: nil: Log serial when IXFR version not in journal

It may be useful to know which version (begin serial) is missing when the IXFR version cannot be found.

Closes #5669

Merge branch '5669-xfrout-log-serial' into 'main'

See merge request isc-projects/bind9!11323

5 months agoLog serial when IXFR version not in journal
Matthijs Mekking [Fri, 5 Dec 2025 08:49:01 +0000 (09:49 +0100)] 
Log serial when IXFR version not in journal

It may be useful to know which version (begin serial) is missing when
the IXFR version cannot be found.

5 months agofix: usr: Fix slow speed of NSEC3 optout large delegation zone signing
Matthijs Mekking [Wed, 10 Dec 2025 13:54:46 +0000 (13:54 +0000)] 
fix: usr: Fix slow speed of NSEC3 optout large delegation zone signing

BIND 9.20 takes much more time signing a large delegation zone with NSEC3 optout compared to version 9.18. This has been restored.

Closes #5672

Merge branch '5672-nsec3-optout-takes-too-long' into 'main'

See merge request isc-projects/bind9!11354

5 months agoDon't create NSEC3 nodes for unsigned delegations
Matthijs Mekking [Tue, 9 Dec 2025 12:45:40 +0000 (13:45 +0100)] 
Don't create NSEC3 nodes for unsigned delegations

Instead of creating new nodes for every possible NSEC3 record, only
create them if we are actually going to add a new NSEC3 record.

5 months agoImplement dns_dbiterator_seek3
Matthijs Mekking [Tue, 9 Dec 2025 11:37:20 +0000 (12:37 +0100)] 
Implement dns_dbiterator_seek3

This is a new seek function for dbiterator that is meant to find an
NSEC3 node in a zone database. The difference with dns_dbiterator_seek
is that if the node does not exist, this seek function will point the
iterator to the next NSEC3 name.

5 months agoAdd NSEC3 optout large delegation zone test case
Matthijs Mekking [Fri, 5 Dec 2025 16:01:00 +0000 (17:01 +0100)] 
Add NSEC3 optout large delegation zone test case

This test signs a large delegation with mostly insecure delegations
with NSEC3 optout. Once the NSEC3PARAM record is published, run
dnssec-verify to ensure the zone is correctly signed.

5 months agochg: dev: Compact rdataset implementation for authoritative
Alessio Podda [Wed, 10 Dec 2025 12:22:09 +0000 (12:22 +0000)] 
chg: dev: Compact rdataset implementation for authoritative

This MR introduces a specialized rdataset implementation for authoritative workloads, which leads to substantial memory savings in our perflab tests.

Merge branch 'alessio/auth-compact-slabs' into 'main'

See merge request isc-projects/bind9!11269

5 months agoFix formatting
Alessio Podda [Tue, 9 Dec 2025 21:49:16 +0000 (22:49 +0100)] 
Fix formatting

5 months agoAdd vecheader unit tests
Alessio Podda [Mon, 24 Nov 2025 08:55:31 +0000 (09:55 +0100)] 
Add vecheader unit tests

Adds unit tests for the new rdatavec, doing basic size and case
checking.

5 months agoAdd DNS_VECHEADER_FOREACH
Alessio Podda [Tue, 9 Dec 2025 20:05:27 +0000 (21:05 +0100)] 
Add DNS_VECHEADER_FOREACH

Add a FOREACH macro modelled around the DNS_RDATASET_FOREACH one, that
uses vecheader directly. Useful when you want to manipulate a vecheader
without binding it to avoid having to take the node lock inside qpzone.c.

5 months agoSwitch qpzone to rdatavec
Alessio Podda [Mon, 24 Nov 2025 08:32:43 +0000 (09:32 +0100)] 
Switch qpzone to rdatavec

Replaces rdataslab with rdatavec inside qpzone.c. This leads to a 19.92%
reduction of used memory across perflab workloads.

5 months agoDocument the memory layout of rdatavec
Alessio Podda [Wed, 10 Dec 2025 10:11:39 +0000 (11:11 +0100)] 
Document the memory layout of rdatavec

5 months agoAdd rdatavec
Alessio Podda [Mon, 24 Nov 2025 08:16:18 +0000 (09:16 +0100)] 
Add rdatavec

Add an implementation of rdataset specialized for authoritative
workloads. For now, it is a copy of rdataslab, with redundant fields
from the header removed.

5 months agoAdd slist.h
Alessio Podda [Mon, 24 Nov 2025 08:07:26 +0000 (09:07 +0100)] 
Add slist.h

Add a macro-based singly-linked list implementation to the codebase,
inspired by the doubly-linked list in list.h.

5 months agochg: dev: Remove unused foundname parameter
Alessio Podda [Wed, 10 Dec 2025 11:15:24 +0000 (11:15 +0000)] 
chg: dev: Remove unused foundname parameter

The `foundname` parameter in `qp.c:dns_qp_lookup` was effectively used only in unit tests, as in every case the name is needed, it can be retrieved directly from the node pointer. It also required an inefficient implementation that extracted the name by converting it into a key and then immediately converting it back.

This MR refactors `qp.c:dns_qp_lookup` not to have a foundname parameter, resulting in a 5% speedup in the handling of NXDOMAIN responses in perflab.

Merge branch 'alessio/qp-no-foundname' into 'main'

See merge request isc-projects/bind9!11339

5 months agoFix formatting after refactor
Alessio Podda [Tue, 9 Dec 2025 16:41:33 +0000 (17:41 +0100)] 
Fix formatting after refactor

The removal of the foundname and name parameters from various qp.c
functions led to formatting issues. Restore the correct formatting via
clang-format.

5 months agoRemove maybe_set_name
Alessio Podda [Mon, 1 Dec 2025 14:12:01 +0000 (15:12 +0100)] 
Remove maybe_set_name

Outside of unit tests, the name parameter in dns_qpiter_<...> and
dns_qpchain_<...> is only used in context where the name can be
extracted directly from the underlying node.

This commits modifies the signatures of dns_qpiter_<...> and
dns_qpchain_<...> not to have a name parameter. Where the name parameter
was needed, we now query the node and copy the name directly from it.

This allows us to remove maybe_set_name from qp.c. Besides simplifying
the API, this leads to a performance speedup for NXDOMAIN handling,
as we avoid calling maybe_set_name inside step, and maybe_set_name is
very inefficient.

A copy of the implementation maybe_set_name is retained for the unit
tests.

5 months agoRemove unused foundname parameter
Alessio Podda [Sun, 23 Nov 2025 13:59:30 +0000 (14:59 +0100)] 
Remove unused foundname parameter

The `foundname` parameter in dns_qp_lookup is used only in the unit
tests. This commit simplifies the API by removing it, and modifying the
unit tests to extract the name from pval.

5 months agofix: dev: dns_name_totext() can now resize dynamic buffers
Evan Hunt [Tue, 9 Dec 2025 21:20:06 +0000 (21:20 +0000)] 
fix: dev: dns_name_totext() can now resize dynamic buffers

When `dns_name_totext()` is called with a dynamically allocated
target buffer which is too small for the name, it will now resize
the buffer instead of returning `ISC_R_NOSPACE`.

Merge branch 'each-name-totext-resize' into 'main'

See merge request isc-projects/bind9!11289

5 months agodns_name_totext() can now resize dynamic buffers
Evan Hunt [Wed, 26 Nov 2025 03:48:02 +0000 (19:48 -0800)] 
dns_name_totext() can now resize dynamic buffers

When dns_name_totext() is called with a dynamically allocated
target buffer which is too small for the name, it will resize
the buffer instead of returning ISC_R_NOSPACE.

5 months agochg: usr: Add more information to the rndc recursing output about fetches
Ondřej Surý [Tue, 9 Dec 2025 16:33:26 +0000 (17:33 +0100)] 
chg: usr: Add more information to the rndc recursing output about fetches

This adds more information about the active fetches for debugging and diagnostic purposes.

Merge branch 'ondrej/provide-more-information-in-dns_resolver_dumpfetches' into 'main'

See merge request isc-projects/bind9!11305

5 months agoAdd more information to the rndc recursing output about fetches
Ondřej Surý [Fri, 28 Nov 2025 14:13:58 +0000 (15:13 +0100)] 
Add more information to the rndc recursing output about fetches

It is possible to have a fetch that is active, but it has been cloned,
so it won't be used when found in the hash table.   The fetch options
also prevent matching in the hash table, so add a hexadecimal dump of
the fctx->options to the output.

5 months agochg: test: Convert all named.conf in system tests to jinja2
Nicki Křížek [Tue, 9 Dec 2025 13:27:31 +0000 (14:27 +0100)] 
chg: test: Convert all named.conf in system tests to jinja2

Replace all the `named.conf*.in` files to use jinja2 templates instead. This makes it possible to drop the `copy_setports` function, makes room for further `setup.sh` cleanup, and prepares for future de-duplication of the configs (common settings as well as shared configs within one test dir).

Merge branch 'nicki/convert-to-jinja2-templates' into 'main'

See merge request isc-projects/bind9!11332

5 months agoFix a timing issue in notify test
Nicki Křížek [Tue, 9 Dec 2025 10:24:40 +0000 (11:24 +0100)] 
Fix a timing issue in notify test

There are a total of 22 notifies required before the start of the test:
20 for each x1..x20 and two for x21, as it has a couple of servers.

5 months agoRemove obsolete copy_setports
Nicki Křížek [Fri, 5 Dec 2025 14:30:09 +0000 (15:30 +0100)] 
Remove obsolete copy_setports

This function is no longer needed and jinja2 templates are universally
used instead.

5 months agoUse jinja2 templates in kasp test
Nicki Křížek [Mon, 1 Dec 2025 15:25:16 +0000 (16:25 +0100)] 
Use jinja2 templates in kasp test

- ns3 had fips/rsasha1 config variants. These were refactored similarly
  to the way they're handled in nsec3 test.
- ns3 special character zone contains @, which is interpreted by jinja2.
  To avoid, {% raw %} directive was added
- ns6 contained unused policies and named2.conf, these were removed

5 months agoUse jinja2 templates in serve-stale test
Nicki Křížek [Fri, 5 Dec 2025 16:04:33 +0000 (17:04 +0100)] 
Use jinja2 templates in serve-stale test

The ns1 named.conf files were sufficiently similar to allow for
de-duplication. No attempt to de-duplicate ns3 was made due to
significant differences among the config files.

5 months agoUse jinja2 templates in catz test
Nicki Křížek [Fri, 5 Dec 2025 16:03:24 +0000 (17:03 +0100)] 
Use jinja2 templates in catz test

- Use a common ns2/named.conf.j2 template for all the "#TN"
  replacements. Instead of commenting out with sed, render the template
  differently into ns/namedX.conf using variables.
- Keep the final ns2/named7.conf.j2 (formerly ns2/named2.conf.in) as a
  separate template for readability due to significant differences.

5 months agoUse jinja2 templates in rpz test
Nicki Křížek [Fri, 5 Dec 2025 16:17:46 +0000 (17:17 +0100)] 
Use jinja2 templates in rpz test

- The ns3/named.conf.j2 uses has a "#BAD" section that is only included
  after restart. Turn it into ns3/named2.conf.
- Since the original config is then restored, keep a copy of it as
  ns3/named1.conf using a symlink, causing it to be rendered twice.
- Use jinja2 templates for test* files to render the port number instead
  of calling copy_setports in load_db().

5 months agoUse jinja2 templates in staticstub test
Nicki Křížek [Fri, 5 Dec 2025 16:04:47 +0000 (17:04 +0100)] 
Use jinja2 templates in staticstub test

- Instead of strings to be replaced by sed, use proper jinja templates.
- ns3/named1.conf.j2 is basically a copy of the default config, because
  it needs to be restored later in the test.

5 months agoUse jinja2 templates in resolver test
Nicki Křížek [Mon, 8 Dec 2025 10:10:47 +0000 (11:10 +0100)] 
Use jinja2 templates in resolver test

- Move ns1/named.conf.j2 to ns1/named2.conf.j2 and adjust the python
  test to render this template.
- Convert remaining .in files to .j2 and handle the multiple configs.

5 months agoUse jinja2 templates in views test
Nicki Křížek [Fri, 5 Dec 2025 16:39:23 +0000 (17:39 +0100)] 
Use jinja2 templates in views test

- Rename named.conf.j2 to named3.conf.j2 and adjust the python test to
  render this template.
- Handle the n2 and ns3 multiple configs as in other similar cases
  (ns2/named1.conf.in was moved to ns2/named.conf.j2).

5 months agoUse jinja2 templates in legacy test
Nicki Křížek [Fri, 5 Dec 2025 16:04:00 +0000 (17:04 +0100)] 
Use jinja2 templates in legacy test

The test uses a second named2.conf template. It only differs by using
dnssec-validation yes. Render both named configs and swap them when
needed.

5 months agoUse jinja2 templates in statistics test
Nicki Křížek [Fri, 5 Dec 2025 16:19:59 +0000 (17:19 +0100)] 
Use jinja2 templates in statistics test

- Merge ns*/statistics-channels.conf.in config snippets into
  conditionally rendered section in ns*/named.conf.j2 files.
- Turn ns2/named.conf.in into ns2/named1.conf.j2 because it is used
  later in the test to restore the original config.
- Symlink the ns2/named.conf.j2 ns2/named1.conf.j2 to pick a starting
  config.

5 months agoUse jinja2 templates in synthfromdnssec test
Nicki Křížek [Fri, 5 Dec 2025 16:19:26 +0000 (17:19 +0100)] 
Use jinja2 templates in synthfromdnssec test

- Merge ns*/statistics-channels.conf.in config snippets into
  conditionally rendered section in ns*/named.conf.j2 files.

5 months agoUse jinja2 templates in tsig test
Nicki Křížek [Fri, 5 Dec 2025 16:05:15 +0000 (17:05 +0100)] 
Use jinja2 templates in tsig test

- Rename ns1/named-fips.conf.in to ns1/named.conf.j2.
- Move MD5-specific stuff into ns1/named-md5.conf.j2 and include it
  conditionally.

5 months agoUse jinja2 templates in rpzrecurse test
Nicki Křížek [Fri, 5 Dec 2025 16:04:25 +0000 (17:04 +0100)] 
Use jinja2 templates in rpzrecurse test

- Change ns2 header into jinja2 template.
- Keep the various ns2 config files as non-templates, same for the
  named.default.conf to be consistent.
- Symlink the ns2/named.default.conf as a jinja2 template to pick a
  starting config. It is rendered as a template to avoid an error when
  the test would overwrite a git-tracked file.
- Use jinja2 templates for the ns3 files, keep named1.conf around
  because it's needed later in the test to restore the config. Symlink
  it to `ns3/named.conf.j2` to select a default config.

5 months agoUse jinja2 templates in nsupdate test
Nicki Křížek [Fri, 5 Dec 2025 16:04:16 +0000 (17:04 +0100)] 
Use jinja2 templates in nsupdate test

- Merge ns1/tls.options.in into ns1/named.conf.j2 and render it
  conditionally. Also conditionally include the additional
  ns1/tls.conf.j2 which is always rendered.
- Use multiple templates for ns7 and replace the copy_setports.
- Use jinja2 template for verylarge.in as well.

5 months agoUse jinja2 templates in notify test
Nicki Křížek [Fri, 5 Dec 2025 16:04:08 +0000 (17:04 +0100)] 
Use jinja2 templates in notify test

- Merge options-tls.conf into named.conf in ns2 and ns4 and render it
  conditionally. Also conditionally include the additional
  named-tls.conf which is always rendered.

5 months agoUse jinja2 templates in forward test
Nicki Křížek [Fri, 5 Dec 2025 16:03:51 +0000 (17:03 +0100)] 
Use jinja2 templates in forward test

- Merge options-tls.conf into named.conf in ns2 and ns4 and render it
  conditionally. Also conditionally include the additional
  named-tls.conf which is always rendered.
- Use multiple templates for ns3 and ns9 and replace the copy_setports.
- In ns3/named2.conf, use "root2.db" directly rather than replacing it
  with "sed" later.

5 months agoUse jinja2 templates in logfileconf test
Nicki Křížek [Fri, 5 Dec 2025 13:50:55 +0000 (14:50 +0100)] 
Use jinja2 templates in logfileconf test

- Replace all named*.in files with jinja2 templates.
- Rename the config files to named.*.conf convention.
- Rename named.plain.in to named.plain.conf.j2 and symlink it as te
  default config.
- Rename named.plainconf.in to named.plainlog.conf.j2 (there is a slight
  difference from named.plain, despite the similar name)

5 months agoUse jinja2 templates in runtime test
Nicki Křížek [Fri, 5 Dec 2025 14:12:29 +0000 (15:12 +0100)] 
Use jinja2 templates in runtime test

- Replace named-altX.conf.in with namedX.conf.j2 to stick with the same
  naming convention across the entire code base. Note than due to
  named1.conf being the first (default) config, the numbers for the altX
  are incremented.
- Turn alt9 into named7 to stick with the same number sequence. Adjust
  the related file names accordingly.

5 months agoUse jinja2 templates in checkzone test
Nicki Křížek [Fri, 5 Dec 2025 14:26:32 +0000 (15:26 +0100)] 
Use jinja2 templates in checkzone test

Render the bad-tsig.db file using jinja2 template to get rid of
copy_setports.

Since the zone is using @ character, use the raw directive to avoid
interpreting it as a variable start.

5 months agoUse jinja2 templates in autosign test
Nicki Křížek [Tue, 9 Dec 2025 08:54:12 +0000 (09:54 +0100)] 
Use jinja2 templates in autosign test

- Include ns3/nsec-only.conf conditionally and always render it.

5 months agoUse jinja2 templates in tsiggss
Nicki Křížek [Fri, 5 Dec 2025 16:18:20 +0000 (17:18 +0100)] 
Use jinja2 templates in tsiggss

- The ns1/named.conf.j2 contains "@" which is a special jinja character,
  use the raw directive to escape it.

5 months agoUse jinja2 templates in transport-change test
Nicki Křížek [Fri, 5 Dec 2025 14:23:25 +0000 (15:23 +0100)] 
Use jinja2 templates in transport-change test

- Replace named*.conf.in files with jinja2 templates.
- When applying the files use plain cp command to copy the rendered
  files.

5 months agoReplace .in with .j2 templates for cases with namedX.conf
Nicki Křížek [Tue, 9 Dec 2025 08:57:12 +0000 (09:57 +0100)] 
Replace .in with .j2 templates for cases with namedX.conf

The following tests use multiple named configs. Previously, these have
been rendered with copy_setports in tests.sh when needed. Transform
these into jinja2 templates and render them during setup. In the tests,
the copy_setports invocations can be then replaced with a simple cp.

5 months agoReplace .in with .j2 templates for simple copy_setports cases
Nicki Křížek [Tue, 9 Dec 2025 09:05:20 +0000 (10:05 +0100)] 
Replace .in with .j2 templates for simple copy_setports cases

Use jinja2 templates instead of *.in templates for named.conf and remove
the copy_setports invocations from setup.sh which are no longer needed.

5 months agoAllow any named*.conf file as a system test artifact
Nicki Křížek [Mon, 1 Dec 2025 16:01:52 +0000 (17:01 +0100)] 
Allow any named*.conf file as a system test artifact

This allows rendering multiple named*.conf files using the jinja2
template engine at test start and then simply copying the required
config to named.conf as needed.

5 months agofix: usr: Resolve "Inbound IXFR performance regression between 9.18.31 and 9.20.9"
Alessio Podda [Tue, 9 Dec 2025 13:06:03 +0000 (13:06 +0000)] 
fix: usr: Resolve "Inbound IXFR performance regression between 9.18.31 and 9.20.9"

This MR adds add some specialized logic to handle IXFR in qpzone, avoiding the need to have one qp transaction per rdataset.

We do this in multiple steps:
 - We extend dns_rdatacallbacks_t vtable to allow subtraction and resigning.
 - We add a new set of api (begin|commit|abort)update to the dbmethods vtable. These API model an incremental update that can be aborted, and make diff apply use these functions instead of adding the rdatasets directly to the database.
 - We add a specialization of dns_rdatacallbacks_t to qpzone that uses a single qp transaction for the entire IXFR.

With this batch API, we see performance improvements over adding one rdataset at a time.

Closes #5442

Merge branch '5442-ixfr-batch-transaction' into 'main'

See merge request isc-projects/bind9!11077

5 months agoFix formatting
Alessio Podda [Fri, 5 Dec 2025 15:14:41 +0000 (16:14 +0100)] 
Fix formatting

Cleanup formatting after IXFR changes.

5 months agoAdd unit tests
Alessio Podda [Mon, 27 Oct 2025 14:43:35 +0000 (15:43 +0100)] 
Add unit tests

5 months agoImplement qpzone specific update path
Alessio Podda [Sat, 25 Oct 2025 09:01:35 +0000 (11:01 +0200)] 
Implement qpzone specific update path

This commit implements a batch update function for qpzone. The main
reason for this is speed: using addrdataset would cause a qp transaction
per rrdataset added, leading to a substantial slowdown compared to
RBTDB. The new API results in a qp transaction per applied diff.

5 months agoAbstract updates into a vtable
Alessio Podda [Fri, 24 Oct 2025 22:47:42 +0000 (00:47 +0200)] 
Abstract updates into a vtable

This commit adds a layer of indirection to the apply_diff logic used by
IXFR and resigning by having the database updates go through a vtable.

We do this in three steps:
 - We extend dns_rdatacallbacks_t vtable to allow subtraction and
   resigning.
 - We add a new set of api (begin|commit|abort)update to the dbmethods
   vtable, that model an incremental update that can be aborted.
 - We extract the core logic of diff_apply into a function that
   satisfies the new interface.
 - We make diff_apply use this new function, and log the results.

The intent of this commit is to allow databases to expose a batch
incremental update implementation, just like they expose a custom
batch creation implementation through (begin|end)load.

5 months agoMove setresign to rdataset.c and rename it
Alessio Podda [Tue, 7 Oct 2025 04:00:17 +0000 (06:00 +0200)] 
Move setresign to rdataset.c and rename it

The setresign method is not diff specific, it only returns the minimum
resign time of an rdataset. Move it to rdataset.c to simplify late
refactoring.

5 months agoClean up ixfr transaction API
Alessio Podda [Sat, 25 Oct 2025 09:01:27 +0000 (11:01 +0200)] 
Clean up ixfr transaction API

Make the API tighter. The idea of this commit is to highlight the
distinction between a database transaction and a journal transaction,
and ensure we run dns_zone_verifydb on error.

Done to simplify a later refactor.

5 months agonew: ci: Add Alpine Linux 3.23
Michal Nowak [Tue, 9 Dec 2025 10:22:42 +0000 (11:22 +0100)] 
new: ci: Add Alpine Linux 3.23

Merge branch 'mnowak/alpine-3.23' into 'main'

See merge request isc-projects/bind9!11321

5 months agoAdd Alpine Linux 3.23
Michal Nowak [Thu, 4 Dec 2025 09:37:19 +0000 (10:37 +0100)] 
Add Alpine Linux 3.23

5 months agofix: test: dns.name module does not have minversion attribute
Michal Nowak [Tue, 9 Dec 2025 10:17:49 +0000 (11:17 +0100)] 
fix: test: dns.name module does not have minversion attribute

The dns module does have it.

Merge branch 'mnowak/enable-selftest-system-test' into 'main'

See merge request isc-projects/bind9!11348

5 months agodns.name module does not have minversion attribute
Michal Nowak [Mon, 8 Dec 2025 19:32:46 +0000 (20:32 +0100)] 
dns.name module does not have minversion attribute

The dns module does have it.

5 months agofix: usr: Fix a catalog zones issue when a member zone could fail to load
Arаm Sаrgsyаn [Tue, 9 Dec 2025 09:52:13 +0000 (09:52 +0000)] 
fix: usr: Fix a catalog zones issue when a member zone could fail to load

A catalog zone's member zone could fail to load in some rare cases, when
the internally generated zone configuration string was exceeding 512
bytes. That condition only was not enough for the issue to arise, but it
was a necessary condition. This could happen, for example, if the catalog
zone's default primary servers list contained a large number of items.
This has been fixed.

Closes #5658

Merge branch '5658-dns_catz_generate_zonecfg-bug-fix' into 'main'

See merge request isc-projects/bind9!11281

5 months agolog failing buffer
Mark Andrews [Tue, 9 Dec 2025 07:07:42 +0000 (18:07 +1100)] 
log failing buffer

5 months agoAdd a check to the catz test to confirm that the issue is fixed
Aram Sargsyan [Wed, 26 Nov 2025 13:50:16 +0000 (13:50 +0000)] 
Add a check to the catz test to confirm that the issue is fixed

Use a member zone with a long list of primaries with long key
names to trigger the issue that was fixed by the previous commit.

5 months agoFix a bug in dns_catz_generate_zonecfg()
Aram Sargsyan [Tue, 25 Nov 2025 18:30:20 +0000 (18:30 +0000)] 
Fix a bug in dns_catz_generate_zonecfg()

The dns_catz_generate_zonecfg() function generates a zone configuration
string to use with a new catalog zone member zone. The buffer for the
string is 512 bytes initially (ISC_BUFFER_INCR), but can be reallocated
when required, when using corresponding isc_buffer functions like
isc_buffer_reserve(), isc_buffer_putstr(), isc_buffer_copyregion(), etc.

However, the dns_name_totext() function, which expects the buffer as an
argument, doesn't automatically resize it if the name doesn't fit there,
but instead just returns ISC_R_NOSPACE.

The chance of this occurring increases when the configuration string is
large due to, for example, long zone name, long list of primary servers
which have keys configured and/or TLS configured.

Use dns_name_format() accompanied with isc_buffer_putstr() instead of
dns_name_totext().

5 months agochg: dev: Create list of dirty headers that needs cleaning
Ondřej Surý [Mon, 8 Dec 2025 18:23:58 +0000 (19:23 +0100)] 
chg: dev: Create list of dirty headers that needs cleaning

Instead of just flagging the qpcache node to be dirty, add the headers
to be cleaned to the dirty list and when cleaning the node, only walk
through the dirty node, not all the headers in the node.

Merge branch 'ondrej/optimize-qpcache-dirty-cleaning' into 'main'

See merge request isc-projects/bind9!11164

5 months agoCreate list of dirty dirty headers that needs cleaning
Ondřej Surý [Tue, 28 Oct 2025 22:11:37 +0000 (23:11 +0100)] 
Create list of dirty dirty headers that needs cleaning

Instead of just flagging the qpcache node to be dirty, add the headers
to be cleaned to the dirty list and when cleaning the node, only walk
through the dirty node, not all the slabtops.

5 months agonew: test: Add FEATURE_* environment variables to system tests
Nicki Křížek [Mon, 8 Dec 2025 17:46:55 +0000 (18:46 +0100)] 
new: test: Add FEATURE_* environment variables to system tests

The purpose of these variables is to be able to detect feature support
without calling feature-test. This becomes useful when detecting feature
support in jinja2 templates.

Merge branch 'nicki/featurest-system-test-env' into 'main'

See merge request isc-projects/bind9!11316

5 months agoAdd FEATURE_* environment variables to system tests
Nicki Křížek [Tue, 2 Dec 2025 16:37:31 +0000 (17:37 +0100)] 
Add FEATURE_* environment variables to system tests

The purpose of these variables is to be able to detect feature support
without calling feature-test. This becomes useful when detecting feature
support in jinja2 templates.

5 months agoRemove unused dlz-filesystem feature check
Nicki Křížek [Tue, 2 Dec 2025 16:09:22 +0000 (17:09 +0100)] 
Remove unused dlz-filesystem feature check

There isn't any system test that uses this feature check.

5 months agoRemove unused ipv6only feature check
Nicki Křížek [Tue, 2 Dec 2025 16:05:14 +0000 (17:05 +0100)] 
Remove unused ipv6only feature check

There isn't any system test that uses this feature check.

5 months agonew: test: Regex support for logs and cmd output in pytest
Nicki Křížek [Mon, 8 Dec 2025 15:14:11 +0000 (16:14 +0100)] 
new: test: Regex support for logs and cmd output in pytest

Improve and unify the handling of regular expressions when searching in logs, files and command output in system tests.
- Use `Re()` for constructing regular expressions, which is an imported shorthand for `re.compile()` (imported as `from re import compile as Re`
- Add new `isctest.text.Text` interface which is a text wrapper that supports the `in` operator for line matching operation for both strings and regular expressions, e.g.:
  - `assert "running" in ns1.log`
  - `assert Re("a.example..*10.0.0.1") in response.out`
- Use the new `isctest.text.Text` for:
  - `isctest.run.cmd()` output, where `.out` and `.err` can be used for stdout and stderr contents
  - `NamedInstance.log` rather than the previous log interface (`.expect()` and `.prohibit()` is no longer available or needed. The `in` operator along with an `assert` statement can be used now instead.)
  - `NamedInstance.rndc()` output, which returns identical output as `isctest.run.cmd()`

Merge branch 'nicki/pytest-grep' into 'main'

See merge request isc-projects/bind9!11054

5 months agoRefactor NamedInstance.rndc() to use EnvCmd() interface
Nicki Křížek [Thu, 23 Oct 2025 13:08:35 +0000 (15:08 +0200)] 
Refactor NamedInstance.rndc() to use EnvCmd() interface

To unify the command handling, utilize EnvCmd() to handle rndc commands:

1. Remove isctest.rndc abstractions. They were intended for an upcoming
   python-only implementation. A couple of years later, it doesn't seem
   to be coming any time soon, so let's stick with the interface that
   makes sense today, i.e. use the same command handling interface
   everywhere.
2. Remove the specialized rndc.log in favor of the generic logging
   already implemented by isctest.run.cmd(). I believe the cause of the
   many rndc(log=False) invocations was that nobody wanted this extra
   file. Yet, logging everything by default makes sense for debugging,
   unless there's a good reason not to. In almost all cases, logging was
   switched to the default (enabled).
3. With the NamedInstance.rndc() call now returning CmdResult rather
   than combined stdout+stderr string, adjust all the invocations to use
   `.out` or `.err` as necessary.
4. Replace some manual rndc invocation and its base argument
   construction with the standardized nsX.rndc() call.
5. In cases where rndc is expected to fail, utilize
   raise_on_exception=False and check the `.rc` from the result, rather
   than handling an exception.
6. In addzone/tests_rndc_deadlock.py, refactor the test slightly to
   avoid using EnvCmd() entirely to avoid spamming the logs. This test
   calls rndc in a loop from multiple threads and such test case is an
   exception which doesn't warrant changing the `isctest.run.cmd()`
   implementation.