]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
8 months agochg: ci: Temporarily disable shotgun jobs alessio/qpznode-embedded-name-buffer-baseline
Nicki Křížek [Wed, 24 Sep 2025 12:28:40 +0000 (14:28 +0200)] 
chg: ci: Temporarily disable shotgun jobs

There's currently an issue with the shotgun workflow that's being
investigated. Until it's resolved, there's no point in creating the
shotgun jobs as they'll just fail.

Merge branch 'nicki/ci-temporarily-disable-shotgun-jobs' into 'main'

See merge request isc-projects/bind9!11005

8 months agoTemporarily disable shotgun jobs
Nicki Křížek [Wed, 24 Sep 2025 11:37:03 +0000 (13:37 +0200)] 
Temporarily disable shotgun jobs

There's currently an issue with the shotgun workflow that's being
investigated. Until it's resolved, there's no point in creating the
shotgun jobs as they'll just fail.

8 months agofix: nil: Reformat strings broken by successive clang-format runs
Petr Špaček [Wed, 24 Sep 2025 12:14:50 +0000 (12:14 +0000)] 
fix: nil: Reformat strings broken by successive clang-format runs

Merge branch 'marka-re-format-strings' into 'main'

See merge request isc-projects/bind9!11002

8 months agore-split STATIC_ASSERT message
Mark Andrews [Tue, 2 Sep 2025 05:49:43 +0000 (15:49 +1000)] 
re-split STATIC_ASSERT message

8 months agore-split log message text
Mark Andrews [Tue, 2 Sep 2025 05:48:35 +0000 (15:48 +1000)] 
re-split log message text

8 months agochg: test: Re-enable delv tests with TSAN
Nicki Křížek [Wed, 24 Sep 2025 11:34:26 +0000 (13:34 +0200)] 
chg: test: Re-enable delv tests with TSAN

With the loopmgr rewrite in 9.20, the delv issue shoud no longer happen,
thus the delv tests can be executed under TSAN as well.

Related #4119

Merge branch 'nicki/delv-reenable-under-tsan' into 'main'

See merge request isc-projects/bind9!10996

8 months agoRe-enable delv tests with TSAN
Nicki Křížek [Thu, 18 Sep 2025 08:39:22 +0000 (10:39 +0200)] 
Re-enable delv tests with TSAN

With the loopmgr rewrite in 9.20, the delv issue shoud no longer happen,
thus the delv tests can be executed under TSAN as well.

8 months agochg: dev: Add option to compile named with static linking and LTO
Ondřej Surý [Wed, 24 Sep 2025 11:23:21 +0000 (13:23 +0200)] 
chg: dev: Add option to compile named with static linking and LTO

Statically linking lib{isc,dns,ns,cfg,isccc} and enabling LTO shows over 10% improvements on all almost measurements in perflab. That said, we can't use Meson's option for LTO since it would result in every binary being compiled with LTO and a great increase in compile time.

To work around it, we add a configuration option that enables LTO and static linking only for the `named` binary.

Merge branch 'alessio/meson-lto-v2' into 'main'

See merge request isc-projects/bind9!10761

8 months agoAdd named-lto option to meson build to named with LTO
Alessio Podda [Thu, 17 Jul 2025 04:51:36 +0000 (06:51 +0200)] 
Add named-lto option to meson build to named with LTO

Enabling LTO yields substantial performance gains on both authoritative
and resolver benchmarks.
But since LTO defers many optimization passes to link time, enabling LTO
across the board would cause an increase in compilation time, as passes
that would be run only once would need to be run for each executable.

As a compromise, this commit adds a named-lto build option, that
compiles the individual object files with the -ffat-lto-object option
and then enables LTO only for the named executable. Object files are
reused between lib*.so and the named executable.

8 months agoUse unique names for probes.d files
Alessio Podda [Thu, 17 Jul 2025 04:51:36 +0000 (06:51 +0200)] 
Use unique names for probes.d files

Enabling LTO in the subsequent commit requires the file names to be
unique and having same probes.d in each of the libraries breaks this
requirement.  Rename probes.d to probes-{isc,dns,ns}.d files and adjust
the includes.

8 months agochg: dev: refactor view creation/configuration loops in dedicated functions
Colin Vidal [Wed, 24 Sep 2025 09:46:38 +0000 (11:46 +0200)] 
chg: dev: refactor view creation/configuration loops in dedicated functions

Refactor a bit of `apply_configuration` by extracting (into respective dedicated function) the logic to build the keystores list, the KASP list as well as creating the view/zones and configuring those. This is the next step of MR !10895 and !10901

While the code is extracted, some global variables has been changed into a function parameters which enable to have a clear view of the dependency of the function, typically, to know if it depends on local configuration object or runtime "production" object. The end goal (not in this MR, but later on) is to move as much as possible initialization logic outside of the exclusive mode.

As a first step, latest commits move the keystores list, KASP list and view/zones creation outside of the exclusive mode. (The view/zone configuration remain in exclusive mode for now, because of a dependency to the runtime "cachelist". This is the target of a next MR.

For the record; while moving the keystores list, KASP list and view/zone creation doesn't have a significant impact on the time the exclusive mode is taken (from my experiment on a 1M small zones instance); moving `configure_views` did have a _massive_ impact (basically, the time spend in the exclusive mode is then non calculable). Configuring views outside the exclusive mode needs more work, which will be done in future MRs.

See #4673

Merge branch 'colin/refactor-applyconfig' into 'main'

See merge request isc-projects/bind9!10910

8 months agocomment about ifs scan twice the first time
Colin Vidal [Tue, 16 Sep 2025 13:49:42 +0000 (15:49 +0200)] 
comment about ifs scan twice the first time

Add comment message about why we're scanning interfaces twice during the
initial configuration (FreeBSD compatibility). See #3583

8 months agoapply_configuration: log subroutines for tests
Colin Vidal [Wed, 10 Sep 2025 13:17:11 +0000 (15:17 +0200)] 
apply_configuration: log subroutines for tests

In order to have a (minimal) test ensuring we don't move back
`apply_configuration` subroutines which can be done before the exclusive
lock is taken, `APPLY_CONFIGURATION_SUBROUTINE_LOG` macro is added and
used for the few subroutines already extracted from the exclusive mode.
Those expected logs are added in `configloading` system test checks.

8 months agocreation of client TLS ctx before exclusive mode
Colin Vidal [Tue, 9 Sep 2025 13:41:17 +0000 (15:41 +0200)] 
creation of client TLS ctx before exclusive mode

When the server is configured (inside `apply_configuration`) a client
TLS context cache is created and attached to the global server object.
It is then used by `configure_view` flow (and also during runtime though
the zone manager).

It is now created before the exclusive mode, and the swap of the
previous TLS cache ctx is done at the end of the exclusive mode, if
everything went well.

This allows us (among other follow-up changes) to move the
`configure_views` function outside of the exclusive mode.

8 months agomove creation of keystores, kasp list and view outside of exclusive mode
Colin Vidal [Mon, 8 Sep 2025 13:57:47 +0000 (15:57 +0200)] 
move creation of keystores, kasp list and view outside of exclusive mode

The keystores initialization, the KASP list initialization as well as
the initialization of the view no longer depends of any data shared by
running "production" objects during re-configuration of the server. This
allows us to move those outside (before) the exclusive mode is taken.

8 months agocfg_aclconfctx_t object is part of named_server
Colin Vidal [Mon, 8 Sep 2025 12:58:47 +0000 (14:58 +0200)] 
cfg_aclconfctx_t object is part of named_server

`named_g_actconfctx` is a global variable holding the ACL configuration
context alive (in particular, to dynamically load zones). However, this
object is build once per configuration (early) and is used only inside
server.c `apply_configuration` flow. (Two exceptions: the shutdown flow,
still in server.c and plugin check flow, which doesn't need it, so it's
NULL in such case).

Instead of leaving this global publicly exposed, it is now part of the
`named_server_t` object. This allows us to clearly see that, when
reconfigureing the server, the new instance of the ACL context is known
only by the newly built object and not currently used by "production"
object; and will help to move move logic before the exclusive mode is
taken.

The other advantage is that the ACL configuration context can now be
built before the exclusive lock as well.

8 months agoapply_configuration: bump config map before exclusive mode
Colin Vidal [Mon, 8 Sep 2025 09:07:29 +0000 (11:07 +0200)] 
apply_configuration: bump config map before exclusive mode

Moving the config map building outside of the exclusive mode, and this
is local data only and no runtime object uses it.

8 months agoapply_configuation: add configure_keystores
Colin Vidal [Mon, 8 Sep 2025 08:46:11 +0000 (10:46 +0200)] 
apply_configuation: add configure_keystores

The keystores list build logic was inlined in apply_configuration, this
commit extracts it into its own function.

8 months agoapply_configuration: add configure_kasplist
Colin Vidal [Thu, 28 Aug 2025 15:29:23 +0000 (17:29 +0200)] 
apply_configuration: add configure_kasplist

The kasplist (dnssec-policy defined in the builtin and global
configuration options) was built inside apply_configuration. This
commit extracts this logic into its separate function.

In order to make the view configuration independent of the global
`server` object, the newly built kasplist is now passed as parameter.
(This eventually will help to be able to configure the views outside of
the exclusive mode by limiting its dependency to the global
`server`/`named_g_server`).

8 months agoapply_configuration: remove builtin_viewlist
Colin Vidal [Tue, 26 Aug 2025 11:19:10 +0000 (13:19 +0200)] 
apply_configuration: remove builtin_viewlist

When creating/configuring the view, the user-defined views are built and
set into the viewlist, then builtin-view inside the builtin_viewlist.
But there is no seperate logic applied to those two lists, and they are
immediately merged into viewlist right after. This commit removes this
intermediate list and add builtin-views directly into the main viewlist
instead.

8 months agorefactor view creation/config in apply_configuration
Colin Vidal [Tue, 26 Aug 2025 10:35:56 +0000 (12:35 +0200)] 
refactor view creation/config in apply_configuration

In order to help splitting apply_configuration, the inline loops and bit
of logic around it for views creation and configuration, each of those
are now in a dedicatated function.

8 months agochg: dev: Use lock-free hashtable for storing resolver fetch contexts
Ondřej Surý [Tue, 23 Sep 2025 22:08:45 +0000 (00:08 +0200)] 
chg: dev: Use lock-free hashtable for storing resolver fetch contexts

Replace the locked hashmap with the lock-free hashtable from the RCU
library and protect the fetch contexts against reuse by replacing the
libisc reference counting with urcu_ref that can soft-fail in situation
where the reference count is already zero.  This allows us to easily
skip re-using the fetch context if it is already in process of being
destroyed.

Merge branch 'ondrej/use-urcu-lfht-for-resolver-tables' into 'main'

See merge request isc-projects/bind9!10653

8 months agofixup! Use lock-free hashtable for storing resolver fetch contexts
Ondřej Surý [Tue, 23 Sep 2025 10:04:35 +0000 (12:04 +0200)] 
fixup! Use lock-free hashtable for storing resolver fetch contexts

8 months agoUse lock-free hashtable for storing resolver fetch contexts
Ondřej Surý [Wed, 17 Sep 2025 13:08:10 +0000 (15:08 +0200)] 
Use lock-free hashtable for storing resolver fetch contexts

Previously, the fetch contexts were stored inside rwlocked hashmap
table.  This was one of the most contended places for the resolver,
especially in the cold cache situation.

Replace the locked hashmap with the lock-free hashtable from the RCU
library and protect the fetch contexts against reuse by replacing the
libisc reference counting with urcu_ref that can soft-fail in situation
where the reference count is already zero.  This allows us to easily
skip re-using the fetch context if it is already in process of being
destroyed.

8 months agochg: dev: Add a circular reference between slabtops for type and RRSIG(type)
Ondřej Surý [Tue, 23 Sep 2025 22:07:32 +0000 (00:07 +0200)] 
chg: dev: Add a circular reference between slabtops for type and RRSIG(type)

Previously, the slabtops for "type" and its signature was only loosely
coupled and the headers could expire at different time (both TTL and LRU
based expiry).  Add a .related member to the slabtop that allows us to
expire the headers in both related headers and also optimize the lookups
because now both slabtops are looked up at the same time.

Closes #3396

Merge branch '3396-bind-rrsigs-to-records' into 'main'

See merge request isc-projects/bind9!10985

8 months agoRefactor find headers to make use of related
Ondřej Surý [Tue, 23 Sep 2025 07:54:52 +0000 (09:54 +0200)] 
Refactor find headers to make use of related

Change the code of finding headers to make use of the related circular
reference.

Co-authored-by: Matthijs Mekking <matthijs@isc.org>
8 months agoExpire related headers at the same time
Ondřej Surý [Tue, 23 Sep 2025 07:54:45 +0000 (09:54 +0200)] 
Expire related headers at the same time

Previously, the slabtops for "type" and its signature was only loosely
coupled and the headers could expire at different time (both TTL and LRU
based expiry).  This commit expires the headers in both related
headers.

Co-authored-by: Matthijs Mekking <matthijs@isc.org>
8 months agoAdd a circular reference between slabtops for type and RRSIG(type)
Ondřej Surý [Tue, 23 Sep 2025 07:54:38 +0000 (09:54 +0200)] 
Add a circular reference between slabtops for type and RRSIG(type)

Previously, the slabtops for "type" and its signature was only loosely
coupled.  Add a .related member to the slabtop that allows us to
optimize the lookups because now both slabtops are looked up at the
same time.

Co-authored-by: Matthijs Mekking <matthijs@isc.org>
8 months agoRefactor find headers
Ondřej Surý [Tue, 23 Sep 2025 07:54:30 +0000 (09:54 +0200)] 
Refactor find headers

Another recurring code pattern that can be moved into a separate
function.

Co-authored-by: Matthijs Mekking <matthijs@isc.org>
8 months agoRefactor check header
Ondřej Surý [Tue, 23 Sep 2025 07:54:11 +0000 (09:54 +0200)] 
Refactor check header

There was a pattern where first the header was checked for NULL
and then for being stale. In both cases the code path is the same
so it makes sense to put them in a separate function.

Co-authored-by: Matthijs Mekking <matthijs@isc.org>
8 months agoMove the size of the expired data into expireheader
Ondřej Surý [Tue, 23 Sep 2025 07:53:41 +0000 (09:53 +0200)] 
Move the size of the expired data into expireheader

Co-authored-by: Matthijs Mekking <matthijs@isc.org>
8 months agochg: dev: Convert slabtop and slabheader to use the cds list
Ondřej Surý [Tue, 23 Sep 2025 22:06:35 +0000 (00:06 +0200)] 
chg: dev: Convert slabtop and slabheader to use the cds list

This is the first MR in series that aims to reduce the node locking
by replacing the single-linked list of slabtop(s) and slabheader(s)
with CDS linked list.  This commit doesn't do anything else beyond
replacing .next and .down links with the cds_list_head.  The RCU
semantics will be added later.

Merge branch 'ondrej/use-rcu-list-for-slabtop' into 'main'

See merge request isc-projects/bind9!10944

8 months agoConvert slabheader to use the cds_list
Ondřej Surý [Fri, 12 Sep 2025 16:08:23 +0000 (18:08 +0200)] 
Convert slabheader to use the cds_list

This is the second commit in series that aims to reduce the node locking
by replacing the single-linked list of slabheader(s) with CDS linked list.
This commit doesn't do anything else beyond replacing .next link with
the cds_list_head.  RCU semantics is going to be added in the subsequent
commits.

8 months agoConvert slabtop to use the cds_list
Ondřej Surý [Fri, 12 Sep 2025 09:25:40 +0000 (11:25 +0200)] 
Convert slabtop to use the cds_list

This is the first commit in series that aims to reduce the node locking
by replacing the single-linked list of slabtop(s) with CDS linked list.
This commit doesn't do anything else beyond replacing .next link with
the cds_list_head.  RCU semantics is going to be added in the subsequent
commits.

8 months agofix: dev: Fix datarace between unlocking fctx lock and shuttingdown fctx
Ondřej Surý [Tue, 23 Sep 2025 09:17:53 +0000 (11:17 +0200)] 
fix: dev: Fix datarace between unlocking fctx lock and shuttingdown fctx

There was a data race where new fetch response could be added to the
fetch context after we unlock the fetch context and before we shut it
down.  This could cause assertion failure when fctx__done() was called
with ISC_R_SUCCESS because there was originally no fetch response, but
new fetch response without associated dataset was added before we had a
chance to shutdown the fetch context.  This manifested in the
validated() callback, where cache_rrset() now returns ISC_R_SUCCESS
instead of DNS_R_UNCHANGED when cache was not changed.  However the data
race was wrong on a general level.

Add new argument to fctx__done() that allows to call it with fctx->lock
already acquired to prevent these data races.

Closes #5507

Merge branch '5507-dont-release-fctx-lock-on-done' into 'main'

See merge request isc-projects/bind9!10961

8 months agoFix datarace between unlocking fctx lock and shuttingdown fctx
Ondřej Surý [Thu, 11 Sep 2025 08:53:47 +0000 (10:53 +0200)] 
Fix datarace between unlocking fctx lock and shuttingdown fctx

There was a data race where new fetch response could be added to the
fetch context after we unlock the fetch context and before we shut it
down.  This could cause assertion failure when fctx__done() was called
with ISC_R_SUCCESS because there was originally no fetch response, but
new fetch response without associated dataset was added before we had a
chance to shutdown the fetch context.  This manifested in the
validated() callback, where cache_rrset() now returns ISC_R_SUCCESS
instead of DNS_R_UNCHANGED when cache was not changed.  However the data
race was wrong on a general level.

When the fctx__done() is called with ISC_R_SUCCESS as result is expects
the fctx->lock to be already acquired to prevent these data races.

8 months agoSplit the fctx_done() into success and failure variants
Ondřej Surý [Thu, 11 Sep 2025 08:53:47 +0000 (10:53 +0200)] 
Split the fctx_done() into success and failure variants

The split will allow us to call fctx__done() with fctx->lock acquired
when it is called with ISC_R_SUCESS to prevent data races when finishing
the fetch context.

8 months agochg: ci: Do not mangle named path in respdiff
Michal Nowak [Thu, 18 Sep 2025 13:51:14 +0000 (15:51 +0200)] 
chg: ci: Do not mangle named path in respdiff

Merge branch 'mnowak/respdiff-do-not-mangle-named-path' into 'main'

See merge request isc-projects/bind9!10855

8 months agoDo not mangle named path in respdiff
Michal Nowak [Wed, 13 Aug 2025 16:22:29 +0000 (18:22 +0200)] 
Do not mangle named path in respdiff

8 months agochg: ci: Only run relevant CI jobs based on the changes
Nicki Křížek [Thu, 18 Sep 2025 13:27:02 +0000 (15:27 +0200)] 
chg: ci: Only run relevant CI jobs based on the changes

Trigger selected CI jobs on MR automatically only if there are related
code changes. Otherwise, offer an option to run the jobs manually in
MRs. For other sources, like schedules, tags etc., execute the jobs as
usual.

Merge branch 'nicki/ci-restrict-rules-changes' into 'main'

See merge request isc-projects/bind9!10987

8 months agoRun shfmt on util/check-make-install.sh.in
Nicki Křížek [Thu, 18 Sep 2025 11:55:00 +0000 (13:55 +0200)] 
Run shfmt on util/check-make-install.sh.in

8 months agoOnly run relevant CI jobs based on the changes
Nicki Křížek [Wed, 17 Sep 2025 13:51:39 +0000 (15:51 +0200)] 
Only run relevant CI jobs based on the changes

Trigger selected CI jobs on MR automatically only if there are related
code changes. Otherwise, offer an option to run the jobs manually in
MRs. For other sources, like schedules, tags etc., execute the jobs as
usual.

8 months agoAdd .sh extension to shell scripts
Nicki Křížek [Thu, 18 Sep 2025 09:51:46 +0000 (11:51 +0200)] 
Add .sh extension to shell scripts

Use .sh(.in) file extension consistently for shell scripts
to allow more reliable detection of shell scripts based on their file
extension.

8 months agofix: usr: preserve cache when reload fails and reload the server again
Colin Vidal [Wed, 17 Sep 2025 15:38:54 +0000 (17:38 +0200)] 
fix: usr: preserve cache when reload fails and reload the server again

Fixes an issue where failing to reconfigure/reload the server would prevent to preserved the views caches on the subsequent server reconfiguration/reload.

Closes #5523

Merge branch 'colin/fix-cache-revert' into 'main'

See merge request isc-projects/bind9!10984

8 months agopreserve cache when reload fails
Colin Vidal [Tue, 16 Sep 2025 15:14:33 +0000 (17:14 +0200)] 
preserve cache when reload fails

If the server is reloaded, new views are created and preexisting cache
is attached to those _but_ something goes wrong later, the previous
views are restored but the previous cache list is destroyed. This makes
the subsequent reload to drop the existing cache. This fixes it by
avoiding a mutation of the old cache list.

8 months agotest that cache is preserved on reconfing failure
Colin Vidal [Tue, 16 Sep 2025 15:14:46 +0000 (17:14 +0200)] 
test that cache is preserved on reconfing failure

A named bug scrap the cache on a second reload after an initial reload
failure. Adds a test checking that the cache is preserved between server
reconfiguration/reloads even if it fails at some point (after attempting
to re-use the cache) and the server is re-loaded later.

8 months agochg: dev: Squash the qpcache tree and nsec tries
Ondřej Surý [Wed, 17 Sep 2025 13:59:13 +0000 (15:59 +0200)] 
chg: dev: Squash the qpcache tree and nsec tries

The dns_qpcache already had all the namespace changes needed to put the
normal data and auxiliary NSEC data into a single tree.  Remove the
extra nsec QP trie and use the single QP trie for all the cache data.

Merge branch 'ondrej/use-qp-namespace-in-cache' into 'main'

See merge request isc-projects/bind9!10975

8 months agoAdd more unit tests for dns_qp unit
Ondřej Surý [Tue, 16 Sep 2025 10:01:44 +0000 (12:01 +0200)] 
Add more unit tests for dns_qp unit

Add basic unit tests and add missing DbC checks for mandatory
dns_qp_create() arguments.

8 months agoRemove dns_dbtree_t and its usage
Ondřej Surý [Mon, 15 Sep 2025 16:07:07 +0000 (18:07 +0200)] 
Remove dns_dbtree_t and its usage

As we removed the ability to count nodes in the auxiliary trees (because
there are no auxiliary trees), we can also cleanup the API and
associated enum type (dns_dbtree_t).

8 months agoSquash the qpcache tree and nsec trees
Ondřej Surý [Mon, 15 Sep 2025 15:46:39 +0000 (17:46 +0200)] 
Squash the qpcache tree and nsec trees

The dns_qpcache already had all the namespace changes needed to put the
normal data and auxiliary NSEC data into a single tree.  Remove the
extra nsec QP trie and use the single QP trie for all the cache data.

8 months agoRemove the dbiterator_{last,prev} from the qpcache
Ondřej Surý [Tue, 16 Sep 2025 09:45:51 +0000 (11:45 +0200)] 
Remove the dbiterator_{last,prev} from the qpcache

The dbiterator_{last,prev} functions are not used in the cache, and the
implementation would get quite complicated when we squash the main and
nsec trees together.  It's easier to just not implement these.

8 months agoRemove CacheNSECNodes statistics counter
Ondřej Surý [Mon, 15 Sep 2025 16:02:08 +0000 (18:02 +0200)] 
Remove CacheNSECNodes statistics counter

There is no auxiliary NSEC tree, so we can't count the NSEC nodes
separately.  Remove the CacheNSECNodes statistics counter as it would be
always zero.

8 months agochg: test: Improve root zone loading into AsyncServer
Petr Špaček [Wed, 17 Sep 2025 13:22:15 +0000 (13:22 +0000)] 
chg: test: Improve root zone loading into AsyncServer

Merge branch 'pspacek/test-server-root' into 'main'

See merge request isc-projects/bind9!10981

8 months agoAdd ability to load root zone into AsyncServer
Petr Špaček [Fri, 11 Jul 2025 19:10:19 +0000 (21:10 +0200)] 
Add ability to load root zone into AsyncServer

We would prefer if explicit $ORIGIN is used only for root zone and
nothing else, solely to avoid zone files named "..db". For all other
zones the file name should match zone name.

8 months agofix: nil: Small qpcache and qpzone related fixes
Ondřej Surý [Tue, 16 Sep 2025 16:49:30 +0000 (18:49 +0200)] 
fix: nil: Small qpcache and qpzone related fixes

Merge branch 'ondrej/little-fixups-in-qp' into 'main'

See merge request isc-projects/bind9!10970

8 months agoUse result of first_*_header() calls instead of direct value
Ondřej Surý [Sat, 13 Sep 2025 04:10:29 +0000 (06:10 +0200)] 
Use result of first_*_header() calls instead of direct value

Fix places where we got the header by calling first_*_header() function,
but then worked with top->header instead of the result.

8 months agoFix up the descriptions in rdataslab.h
Ondřej Surý [Sat, 13 Sep 2025 04:05:41 +0000 (06:05 +0200)] 
Fix up the descriptions in rdataslab.h

There were a lot of outdated comments. They've been updated or removed.

8 months agofix: nil: Fix dns_qpmulti_memusage() on empty dns_qpmulti_t instance
Ondřej Surý [Tue, 16 Sep 2025 14:43:46 +0000 (16:43 +0200)] 
fix: nil: Fix dns_qpmulti_memusage() on empty dns_qpmulti_t instance

The dns_qpmulti_memusage() causes assertion failure when called on
freshly created qpmulti instance because the qp->usage hasn't been
allocated yet.

Merge branch 'ondrej/fix-qpmulti_memusage' into 'main'

See merge request isc-projects/bind9!10977

8 months agoFix dns_qpmulti_memusage() on empty dns_qpmulti_t instance
Ondřej Surý [Tue, 16 Sep 2025 12:11:08 +0000 (14:11 +0200)] 
Fix dns_qpmulti_memusage() on empty dns_qpmulti_t instance

The dns_qpmulti_memusage() causes assertion failure when called on
freshly created qpmulti instance because the qp->usage hasn't been
allocated yet.

8 months agochg: dev: simplify nchildren count in isc_nm_listenudp
Colin Vidal [Tue, 16 Sep 2025 13:49:49 +0000 (15:49 +0200)] 
chg: dev: simplify nchildren count in isc_nm_listenudp

Slight simplification of the logic to define .nchildren listening UDP
socket.

Merge branch 'colin/simplify-socket-nchildren-count' into 'main'

See merge request isc-projects/bind9!10978

8 months agosimplify nchildren count in isc_nm_listenudp
Colin Vidal [Tue, 16 Sep 2025 12:15:07 +0000 (14:15 +0200)] 
simplify nchildren count in isc_nm_listenudp

Slight simplification of the logic to define .nchildren listening UDP
socket.

8 months agofix: usr: Add chroot check to meson.build
Mark Andrews [Tue, 16 Sep 2025 12:06:46 +0000 (22:06 +1000)] 
fix: usr: Add chroot check to meson.build

The meson build procedure was not checking for the existence of
the chroot function.  This has been fixed.

Closes #5519

Merge branch '5519-add-chroot-check-to-meson-build' into 'main'

See merge request isc-projects/bind9!10973

8 months agoCheck if chroot exists
Mark Andrews [Mon, 15 Sep 2025 08:30:18 +0000 (10:30 +0200)] 
Check if chroot exists

8 months agorem: dev: remove orphan dns_loadmgr_t type
Colin Vidal [Mon, 15 Sep 2025 20:39:14 +0000 (22:39 +0200)] 
rem: dev: remove orphan dns_loadmgr_t type

dns_loadmgr_t typedef is declared but never defines as well as a pointer
of this type in named_server_t. Removing it.

Merge branch 'colin/removednsloadmgr' into 'main'

See merge request isc-projects/bind9!10974

8 months agoremove orphan dns_loadmgr_t type
Colin Vidal [Mon, 15 Sep 2025 14:32:11 +0000 (16:32 +0200)] 
remove orphan dns_loadmgr_t type

dns_loadmgr_t typedef is declared but never defines as well as a pointer
of this type in named_server_t. Removing it.

8 months agofix: dev: clean up the dns_db API
Evan Hunt [Mon, 15 Sep 2025 16:11:59 +0000 (16:11 +0000)] 
fix: dev: clean up the dns_db API

Some of the API calls in `dns_db` were obsolete, and have been removed. Others were more complicated than necessary, and have been refactored to simplify.

Merge branch 'each-cleanup-db-api' into 'main'

See merge request isc-projects/bind9!10830

8 months agoremove dns_db_{un,}locknode
Evan Hunt [Thu, 14 Aug 2025 23:28:11 +0000 (16:28 -0700)] 
remove dns_db_{un,}locknode

remove the dns_db_locknode() and _unlocknode() calls, so that callers no
longer have the ability to directly manipulate the internal locking of
cache and zone databases.

8 months agomake getoriginnode implementation optional
Evan Hunt [Mon, 11 Aug 2025 19:13:53 +0000 (12:13 -0700)] 
make getoriginnode implementation optional

if the dns_db_getoriginnode() call is not implemented, we can
fall back to running dns_db_findnode() on the database origin.
we now only implement getoriginnode directly in databases where
it's clearly faster than the fallback implementation would be.

8 months agominor cleanup in sdlz.c
Evan Hunt [Thu, 7 Aug 2025 21:24:01 +0000 (14:24 -0700)] 
minor cleanup in sdlz.c

dns_db_issecure() and dns_db_nodecount() return false and 0,
respectively, if they are not implemented, so there's no need to
have implementation functions that only return false and 0.

8 months agoremove unnecessary dns_db_nodefullname()
Evan Hunt [Thu, 7 Aug 2025 19:49:03 +0000 (12:49 -0700)] 
remove unnecessary dns_db_nodefullname()

now that node->name is accessible as a common dbnode member,
it's no longer necessary to provide an API call for that.

8 months agoremove node lock for settrust and clearprefetch
Evan Hunt [Tue, 5 Aug 2025 04:26:01 +0000 (21:26 -0700)] 
remove node lock for settrust and clearprefetch

dns_rdataset_clearprefetch() performs an atomic operation,
so it didn't actually need to lock the database node.

dns_rdataset_settrust() updates header->trust; this is also
now atomic, so it doesn't need to lock the node now either.

8 months agomerge dns_db_find/findext and dns_db_findnode/findnodeext
Evan Hunt [Mon, 4 Aug 2025 23:54:08 +0000 (16:54 -0700)] 
merge dns_db_find/findext and dns_db_findnode/findnodeext

the dns_db_findext and _findnodeext calls are extended versions
of dns_db_find and _findnode, which take additional arguments for
client information in order to support ECS. previously, database
implementations could support either API call, with cross-compatibility
so that, for example, dns_db_findext() could call a find implementation
if findext was not implemented, and dns_db_find() could call findext
if find was not implemented.

this has now been simplified. the find and findnodeext implementations
now support client info.  all database implementations will now provide
these calls.  implementations which do not support ECS will simply
ignore the clientinfo and clientinfomethods parameters.

this only affects the underlying implementation; callers will still
use the same interface. dns_db_find() and dns_db_findnode() are now
macros which pass NULL to the clientinfo parameters, so that callers
don't have to do so explicitly. dns_db_findext() and dns_db_findnodeext()
are still available for callers that do wish to pass clientinfo pointers.

8 months agoremove obsolete dns_db_hashsize()
Evan Hunt [Mon, 4 Aug 2025 23:24:09 +0000 (16:24 -0700)] 
remove obsolete dns_db_hashsize()

this function's purpose was to populate the "CacheBuckets" statistic,
but there are no databases left that implemented it, so the return
value was always 0. "CacheBuckets" has now been removed from the
statistics, and the dns_db_hashsize() API call has been removed.

8 months agodns_rdatalist functions are not for general use
Evan Hunt [Mon, 4 Aug 2025 23:06:23 +0000 (16:06 -0700)] 
dns_rdatalist functions are not for general use

the rdataset method implementation functions in dns/rdatalist.c (i.e.,
dns_rdatalist_first, _next, etc) are not meant to be called directly;
they're called via dns_rdataset_first(), dns_rdataset_next(), etc.

in dnssec-ksr.c, a list-based rdataset was iterated using these
functions. this has been fixed, and the functions have been renamed
to use the `dns__` prefix as a signal that they aren't meant to be
used outside the rdataset implementation.

8 months agoremove obsolete dns_db_setloop()
Evan Hunt [Mon, 4 Aug 2025 21:31:59 +0000 (14:31 -0700)] 
remove obsolete dns_db_setloop()

no database implementation has needed an event loop
since the RBT cache was removed, so the setloop API call
is no longer needed.

8 months agofix: dev: Fix detection of whether node is active in find_wildcard()
Ondřej Surý [Mon, 15 Sep 2025 15:45:15 +0000 (17:45 +0200)] 
fix: dev: Fix detection of whether node is active in find_wildcard()

The current code would fail during the write transaction.  The first
header would not match the search->serial and the node might be
incorrectly detected as inactive.

Merge branch 'ondrej/fix-find-wildnode-active-node-detection' into 'main'

See merge request isc-projects/bind9!10972

8 months agoFix detection whether node is active in find_wildcard()
Ondřej Surý [Sat, 13 Sep 2025 04:19:43 +0000 (06:19 +0200)] 
Fix detection whether node is active in find_wildcard()

The current code would fail during the write transaction.  The first
header would not match the search->serial and the node might be
incorrectly detected as inactive.

8 months agochg: dev: Make the database ownercase modifiable only via addrdataset()
Ondřej Surý [Mon, 15 Sep 2025 15:31:50 +0000 (17:31 +0200)] 
chg: dev: Make the database ownercase modifiable only via addrdataset()

Simplify the implementation around the database ownercase.  Remove the
dns_rdataset_setownercase() implementation for the slabheaders and only
allow setting ownercase on rdatalists and rdatasets.  The ownercase in
the database can now be set only with dns_db_addrdataset() by passing
rdataset with correctly set ownercase.

Merge branch 'ondrej/make-database-ownercase-mostly-constant' into 'main'

See merge request isc-projects/bind9!10971

8 months agoMake the database ownercase modifiable only via addrdataset()
Ondřej Surý [Sat, 13 Sep 2025 04:56:58 +0000 (06:56 +0200)] 
Make the database ownercase modifiable only via addrdataset()

Simplify the implementation around the database ownercase.  Remove the
dns_rdataset_setownercase() implementation for the slabheaders and only
allow setting ownercase on rdatalists and rdatasets.  The ownercase in
the database can now be set only with dns_db_addrdataset() by passing
rdataset with correctly set ownercase.

8 months agoMerge tag 'v9.21.12'
Andoni Duarte Pintado [Thu, 11 Sep 2025 13:57:40 +0000 (15:57 +0200)] 
Merge tag 'v9.21.12'

8 months agofix: dev: do not inline dns_zone_gethooktable
Colin Vidal [Thu, 11 Sep 2025 12:21:24 +0000 (14:21 +0200)] 
fix: dev: do not inline dns_zone_gethooktable

Since !10959 `dns_zone_gethooktable()` is only called once per query,
and the suspicion (from perflab analysis) that this (simple, as just
returning a pointer) call was slowing things down (perhaps because of
code locality reasons?) doesn't matter anymore. So even if !10959
inlined it, it shouldn't matter anymore.

Merge branch 'colin/minimize-hooktable-lookup-followup' into 'main'

See merge request isc-projects/bind9!10962

8 months agodo not inline dns_zone_gethooktable
Colin Vidal [Thu, 11 Sep 2025 09:51:06 +0000 (11:51 +0200)] 
do not inline dns_zone_gethooktable

Since !10959 `dns_zone_gethooktable()` is only called once per query,
and the suspicion (from perflab analysis) that this (simple, as just
returning a pointer) call was slowing things down (perhaps because of
code locality reasons?) doesn't matter anymore. So even if !10959
inlined it, it shouldn't matter anymore.

8 months agochg: doc: ARM tweaks
Petr Špaček [Thu, 11 Sep 2025 11:04:35 +0000 (11:04 +0000)] 
chg: doc: ARM tweaks

Merge branch 'pspacek/reorder-arm-toc' into 'main'

See merge request isc-projects/bind9!10960

8 months agoPrevent Sphinx from messing up syntax with "smartquotes" feature
Petr Špaček [Thu, 11 Sep 2025 09:06:21 +0000 (11:06 +0200)] 
Prevent Sphinx from messing up syntax with "smartquotes" feature

Sphinx's smartquotes feature was rewriting -- to en-dash, "" to proper
English quotes etc. This was messing up syntax at unpredictable places.
Disable this feature instead of attempting to escape all the places in
the manual.

8 months agoReorder appendices in ARM
Petr Špaček [Thu, 11 Sep 2025 08:51:02 +0000 (10:51 +0200)] 
Reorder appendices in ARM

The new order hopefully reflects likelihood of someone reading from start
to the end:

DNSSEC Guide
Manual Pages
General DNS Reference Information
Release Notes
Changelog
A Brief History of the DNS and BIND

8 months agofix: dev: minimize zone hooktable lookups
Colin Vidal [Thu, 11 Sep 2025 06:37:03 +0000 (08:37 +0200)] 
fix: dev: minimize zone hooktable lookups

Merging !10483 caused a performance regression because the zone hooktable had to be looked up every time a hook point was reached, even if no zone plugins were configured. We now look up the zone hooktable when a zone is attached to the query context, and keep a pointer to it until the qctx is destroyed.

Merge branch 'each-zoneplugin-zonehook-once' into 'main'

See merge request isc-projects/bind9!10959

8 months agorename NS_QUERY_RESET to NS_QUERY_CLEANUP
Evan Hunt [Wed, 10 Sep 2025 21:15:57 +0000 (14:15 -0700)] 
rename NS_QUERY_RESET to NS_QUERY_CLEANUP

query_reset() is called during query initialization, but the only
time the NS_QUERY_SETUP hook runs is when it's called from
query_cleanup().  it makes more sense to move the hook point to
there and rename it to NS_QUERY_CLEANUP.

this change caused a crash in the unit tests due to the view being
unnecessarily detached before ns__client_reset_cb() was called.
this has also been fixed.

8 months agodon't call hooks when a query hasn't started
Colin Vidal [Wed, 10 Sep 2025 20:40:44 +0000 (22:40 +0200)] 
don't call hooks when a query hasn't started

guard the call to the NS_QUERY_RESET hook so it's called only if
the view has been set. If the view is NULL, it means the client has
been reset _before_ the query even started, and no other hook could
have been called, so it doesn't make sense to call this one.

this also enables us to avoid a NULL-check on the qctx->view in the
CALL_HOOK macros.

8 months agominimize calls to dns_zone_gethooktable per qctx
Evan Hunt [Wed, 10 Sep 2025 21:05:42 +0000 (14:05 -0700)] 
minimize calls to dns_zone_gethooktable per qctx

add a 'zhooks' member to the query_ctx structure, so that we only
need to look up the hook table for the zone once when iniitalizing
a qctx, and not once for every hook point.

8 months agochg: nil: followup changes from !10779
Evan Hunt [Wed, 10 Sep 2025 17:37:27 +0000 (17:37 +0000)] 
chg: nil: followup changes from !10779

Two follow up changes from !10779: turning a sh-based config test into a python one, as well as guarding a pointer initialization.

Merge branch 'colin/zone-plugins-followup' into 'main'

See merge request isc-projects/bind9!10958

8 months agoconvert config sh-based hooks tests to python
Evan Hunt [Tue, 9 Sep 2025 20:00:23 +0000 (13:00 -0700)] 
convert config sh-based hooks tests to python

The test cases that call named-checkconf have been moved from
tests.sh into the python tests, which are now renamed back
to tests_hooks.py.

8 months agocheck target pointer validity in qctx_save
Evan Hunt [Tue, 9 Sep 2025 19:55:06 +0000 (12:55 -0700)] 
check target pointer validity in qctx_save

Make sure the target pointer address (getting the allocated instance of
qctx) is valid and the pointer is NULL.

8 months agochg: nil: Reduce the code duplication around getting slabheaders from slabtop
Ondřej Surý [Wed, 10 Sep 2025 09:40:32 +0000 (11:40 +0200)] 
chg: nil: Reduce the code duplication around getting slabheaders from slabtop

There was a lot of duplicated code around getting the first header that
exists, is active, and matches the version header from the qpzonedb.
Move the duplicate code into a helper function and unify the same
approach for the qpcache too even though the code is much simpler there.
It should come handy when top->header is something more complicated than
a pointer to first slabheader.

Merge branch 'ondrej/refactor-getting-the-first-slabheader-from-slabtop' into 'main'

See merge request isc-projects/bind9!10953

8 months agoReduce the code duplication around getting slabheaders from slabtop
Ondřej Surý [Tue, 9 Sep 2025 09:32:17 +0000 (11:32 +0200)] 
Reduce the code duplication around getting slabheaders from slabtop

There was a lot of duplicated code around getting the first header that
exists, is active, and matches the version header from the qpzonedb.
Move the duplicate code into a helper function and unify the same
approach for the qpcache too even though the code is much simpler there.
It should come handy when top->header is something more complicated than
a pointer to first slabheader.

8 months agofix: usr: Missing DNSSEC information when CD bit is set in query
Mark Andrews [Wed, 10 Sep 2025 05:54:33 +0000 (15:54 +1000)] 
fix: usr: Missing DNSSEC information when CD bit is set in query

The RRSIGs for glue records were not being cached correctly for CD=1 queries.  This has been fixed.

Closes #5502

Merge branch '5502-fix-missing-rrsig-with-cd' into 'main'

See merge request isc-projects/bind9!10938

8 months agotest that rrsigs are returned for glue with +cd
Mark Andrews [Thu, 4 Sep 2025 00:21:05 +0000 (10:21 +1000)] 
test that rrsigs are returned for glue with +cd

8 months agoRemove dns_rdataset_equals as unneeded
Mark Andrews [Thu, 4 Sep 2025 00:02:43 +0000 (10:02 +1000)] 
Remove dns_rdataset_equals as unneeded

8 months agoFix missing RRSIGs for "glue" lookups with CD=1
Mark Andrews [Wed, 3 Sep 2025 23:57:10 +0000 (09:57 +1000)] 
Fix missing RRSIGs for "glue" lookups with CD=1

The code to test whether to store the RRSIGs on DNS_R_UNCHANGED
with CD=1 was failing because the comparison methods of the two
rdatatset instances were not compatible.  Move the testing into
dns_db_addrdataset(), and request it by setting the DNS_ADD_EQUALOK
option.  If the option is set and the old and new rrsets compare
as equal, dns_db_addrdataset() returns ISC_R_SUCCESS instead of
DNS_R_UNCHANGED.

8 months agofix: test: remove 'signer' files from dnssec test
Evan Hunt [Wed, 10 Sep 2025 04:12:34 +0000 (04:12 +0000)] 
fix: test: remove 'signer' files from dnssec test

When the `dnssec-signzone` tests were moved to the `dnssectools`
system test, an unused copy of the `signer` directory was left in
the `dnssec` test. This has been removed.

Merge branch 'each-cleanup-dnssec-files' into 'main'

See merge request isc-projects/bind9!10873

8 months agoremove 'signer' files from dnssec test
Evan Hunt [Wed, 20 Aug 2025 18:28:32 +0000 (11:28 -0700)] 
remove 'signer' files from dnssec test

when the dnssec-signzone tests were moved to the dnssectools
system test, a unused copy of the 'signer' directory was left in
the dnssec test. This has been removed.