]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 months agoadd type to hooktable_free callbacks each-resolver-plugin 11250/head
Colin Vidal [Mon, 24 Nov 2025 10:28:48 +0000 (11:28 +0100)] 
add type to hooktable_free callbacks

The `hootable_free` callbacks (used in views and zones) are now typed
with `dns_hooktable_free_t`, as the hook definitions are now part of
libdns.

5 months agofixup! move ns/hooks to dns/hooks
Colin Vidal [Mon, 24 Nov 2025 09:05:06 +0000 (10:05 +0100)] 
fixup! move ns/hooks to dns/hooks

5 months agomove ns/hooks to dns/hooks
Evan Hunt [Wed, 19 Nov 2025 03:17:13 +0000 (19:17 -0800)] 
move ns/hooks to dns/hooks

In preparation for allowing resolver plugins as well as query plugins,
the ns_hook* code has been moved to libdns and renamed to dns_hook*.

5 months agochg: dev: add dns_message functions to set EDNS options
Evan Hunt [Fri, 21 Nov 2025 21:18:25 +0000 (21:18 +0000)] 
chg: dev: add dns_message functions to set EDNS options

The new `dns_message_ednsinit()` and `dns_message_ednsaddopt()` functions
allow EDNS options to be added to a message one at a time; it is no
longer necessary to construct a full array of EDNS options and set
them all at once.

This allows us to simplify EDNS option handling code, and in the
future it wlil allow plugins to add EDNS options to existing
messages.

Merge branch 'each-refactor-message-edns' into 'main'

See merge request isc-projects/bind9!11261

5 months agoremove dns_message_buildopt
Evan Hunt [Fri, 21 Nov 2025 07:33:29 +0000 (23:33 -0800)] 
remove dns_message_buildopt

now that the EDNS state is stored within dns_message_t, it's no longer
necessary to have a public API call to build an opt rdataset; we can
just have dns_message_setopt() build the opt record internally.

5 months agoadd dns_message API to add EDNS options
Evan Hunt [Wed, 19 Nov 2025 07:29:12 +0000 (23:29 -0800)] 
add dns_message API to add EDNS options

The new dns_message_ednsinit() and dns_message_ednsaddopt() functions
allow EDNS options to be added to a message one at a time; it is no
longer necessary to construct a full array of EDNS options and set
them all at once.

This allows us to simplify EDNS option handling code, and in the
future it wlil allow plugins to add EDNS options to existing
messages.

5 months agochg: test: Rewrite nsec3 system test to pytest
Matthijs Mekking [Fri, 21 Nov 2025 14:03:05 +0000 (14:03 +0000)] 
chg: test: Rewrite nsec3 system test to pytest

Merge branch 'matthijs-pytestify-nsec3' into 'main'

See merge request isc-projects/bind9!11030

5 months agoWait longer before keymgr is done
Matthijs Mekking [Fri, 21 Nov 2025 08:49:18 +0000 (09:49 +0100)] 
Wait longer before keymgr is done

To check if the key managing for a zone is done, we check a log message.
On some machines, with many zones this may take some time.

Increate the timeout to a minute. Note that most zones will continue
their test case much faster, but with many zones there may be some
straggling.

5 months agoWait until zones are signed before reconfig
Matthijs Mekking [Fri, 21 Nov 2025 08:47:08 +0000 (09:47 +0100)] 
Wait until zones are signed before reconfig

In order to make the tests run reliable, first make sure the key
managing for all the zones has finished before doing running the
reconfig command.

5 months agoOnly render required zones in config for nsec3 tests
Nicki Křížek [Thu, 20 Nov 2025 17:09:58 +0000 (18:09 +0100)] 
Only render required zones in config for nsec3 tests

When all zones are configured, regardless of whether the test module
actually uses them, it makes debugging the logs needlessly more
complicated, as there is a bunch of stuff going on that is completely
unrelated to the test.

Define a list of tested zones in each test module and only render the
named.conf with those zones defined.

5 months agoMove nsec3-change.kasp test to separate module
Matthijs Mekking [Fri, 14 Nov 2025 15:31:42 +0000 (16:31 +0100)] 
Move nsec3-change.kasp test to separate module

This zone has a specific corner case to be tested during the setup.
Move it to a separate module so it is less convoluted.

5 months agoMove check_nsec3_case to common code
Matthijs Mekking [Thu, 13 Nov 2025 18:54:03 +0000 (19:54 +0100)] 
Move check_nsec3_case to common code

With the nsec and nsec3 test cases being nearly identical for all
modules, these can be be unified and moved to common.py.

5 months agoClean up shell tests remnants
Matthijs Mekking [Tue, 30 Sep 2025 13:12:45 +0000 (15:12 +0200)] 
Clean up shell tests remnants

Now that all tests are covered by pytest, we can remove the remnants
of the shell test script.

5 months agoRewrite nsec3 system test to pytest (4/4)
Matthijs Mekking [Tue, 30 Sep 2025 13:11:22 +0000 (15:11 +0200)] 
Rewrite nsec3 system test to pytest (4/4)

Convert the final nsec3 system test case that deals with empty
non-terminals. This is a regression test case for GL #5108.

5 months agoRewrite nsec3 system test to pytest (3/4)
Matthijs Mekking [Tue, 30 Sep 2025 13:06:45 +0000 (15:06 +0200)] 
Rewrite nsec3 system test to pytest (3/4)

This converts two test cases:

1. A zone that previously failed to load is now fixed. Make sure the
   zone is signed correctly with the right NSEC3 parameters.

2. Test case to ensure the salt is the same after a restart, i.e. no
   re-salting takes place. Previously we only tested with salt length
   0, this commit adds a test case for salt length 8 as well.

5 months agoRewrite nsec3 system test to pytest (2/4)
Matthijs Mekking [Tue, 30 Sep 2025 11:25:22 +0000 (13:25 +0200)] 
Rewrite nsec3 system test to pytest (2/4)

This converts the nsec3 system test cases after to reconfiguring the
name server.

Two extra test for nsec3-change.kasp is updated. It depends on the
zone being updated, and a reconfig. This test code is moved to
tests_nsec3_reconfig.py.

Furthermore, an additional 'rndc signing -nsec3param' error test
case has been added.

5 months agoImprove check_auth_nsec3 salt checking
Matthijs Mekking [Tue, 30 Sep 2025 10:33:14 +0000 (12:33 +0200)] 
Improve check_auth_nsec3 salt checking

Since we know the salt after checking the NSEC3PARAM, we might as well
check the NSEC3 records on the NXDOMAIN response that the salt matches.

5 months agoMove parts into a common module
Matthijs Mekking [Tue, 30 Sep 2025 09:48:30 +0000 (11:48 +0200)] 
Move parts into a common module

Some constants and test functionality are the same for test cases
prior and after reconfiguration. Move these into a common module.

5 months agoConvert "in"-style templates to jinja
Matthijs Mekking [Tue, 30 Sep 2025 09:34:13 +0000 (11:34 +0200)] 
Convert "in"-style templates to jinja

Change the named.conf templating to make use of jinja template
rendering. The ns2 server is trivial. The ns3 server configuration
structure has changed:

The common configuration is moved out of named-fips.conf.

The main named.conf file is in named.conf.j2. It always includes the
common part, named-common.conf.j2, and the FIPS part,
named-fips.conf.j2.

The named-fips.conf.j2 and named-rsasha1.conf.j2 templates are
rendered differently depending on the reconfiged status. Mainly the
dnssec-policy for zones are different after reconfiguration, but there
are some other changes to, for example some zones change their
inline-signing setting.

Some zones only exist prior or after the configuration.

Finally, this is a bit hackish: If RSASHA1 is supported, named.conf
includes "named-rsasha1.conf", otherwise it includes the deliberately
empty "named-rsasha0.conf".

5 months agoRewrite nsec3 system test to pytest (1/4)
Matthijs Mekking [Tue, 30 Sep 2025 07:13:38 +0000 (09:13 +0200)] 
Rewrite nsec3 system test to pytest (1/4)

This converts all the nsec3 system test cases prior to reconfiguring the
name server. There are two main classes, one that tests the zone is
correctly signed with NSEC, the other with NSEC3.

Two extra tests for nsec3-dynamic-update-inline.kasp and
nsec3-change.kasp are also rewritten. For the former, we need to
change the 'nsupdate' definition to be able to set the expected RCODE.

5 months agofix: usr: Fix allow-recursion/allow-query-cache inheritance
Evan Hunt [Thu, 20 Nov 2025 20:19:52 +0000 (20:19 +0000)] 
fix: usr: Fix allow-recursion/allow-query-cache inheritance

The merging of the user options and defaults into the effective configuration broke the mutual inheritance of the `allow-recursion`, `allow-query`, and `allow-query-cache` ACLs, and of the `allow-recursion-on` and `allow-query-cache-on` ACLs. This has been fixed.

Closes #5647

Merge branch '5647-allow-recursion-inheritance' into 'main'

See merge request isc-projects/bind9!11254

5 months agofix ACL settings when merging views
Evan Hunt [Thu, 20 Nov 2025 06:09:53 +0000 (22:09 -0800)] 
fix ACL settings when merging views

when merging view objects into the effective configuration, add
allow-query-cache, allow-recursion, allow-query-cache-on and
allow-recursion-on ACLs as needed to reflect the way those
options inherit from each other.

this means the effective configuration is now correct for each
view.  ACLs no longer need to be corrected when applying the
configuration, and the actual effective ACL values will be
displayed in "rndc showconf" and "named-checkconf -pe".

5 months agofix allow-recursion/allow-query-cache inheritance
Evan Hunt [Thu, 20 Nov 2025 01:52:39 +0000 (17:52 -0800)] 
fix allow-recursion/allow-query-cache inheritance

the merging of options and defaults into the effective configuration
broke the mutual inheritance of the allow-recursion, allow-query, and
allow-query-cache ACLs, and of the allow-recursion-on and
allow-query-cache-on ACLs.

this has been corrected by adding a 'cloned' flag to the cfg_obj
structure to indicate whether it was configured explicitly or
cloned from the defaults during parsing. we can then adjust the
ACLs while configuring a view, favoring user-configured values
when they're available over cloned defaults.

currently the adjustments to the ACLs are done in configure_view();
later they'll be moved into the effective configuration and this
special handling can be removed.

5 months agoadd a test for allow-recursion/allow-query-cache inheritance
Evan Hunt [Thu, 20 Nov 2025 00:35:31 +0000 (16:35 -0800)] 
add a test for allow-recursion/allow-query-cache inheritance

allow-recursion is set to "none" in the options block and to
"any" in the view.  allow-query-cache in the view should inherit
the "any", not the "none". (currently this test does not pass.)

5 months agofix: dev: Attach socket before async streamdns_resume_processing
Colin Vidal [Thu, 20 Nov 2025 17:52:29 +0000 (18:52 +0100)] 
fix: dev: Attach socket before async streamdns_resume_processing

Call to `streamdns_resume_processing` is asynchronous but the socket
passed as argument is not attached when scheduling the call.

While there is no reproducible way (so far) to make the socket reference
number down to 0 before `streamdns_resume_processing` is called, attach
the socket before scheduling the call. This guard against an hypothetic
case where, for some reasons, the socket refcount would reach 0, and be
freed from memory when `streamdns_resume_processing` is called.

Closes #5620

Merge branch '5620-attach-socket-streamdns_resume_processing' into 'main'

See merge request isc-projects/bind9!11247

5 months agoattach socket before async streamdns_resume_processing
Colin Vidal [Tue, 18 Nov 2025 09:31:24 +0000 (10:31 +0100)] 
attach socket before async streamdns_resume_processing

Call to `streamdns_resume_processing` is asynchronous but the socket
passed as argument is not attached when scheduling the call.

While there is no reproducible way (so far) to make the socket reference
number down to 0 before `streamdns_resume_processing` is called, attach
the socket before scheduling the call. This guard against an hypothetic
case where, for some reasons, the socket refcount would reach 0, and be
freed from memory when `streamdns_resume_processing` is called.

5 months agochg: usr: Reduce the number of outgoing queries
Ondřej Surý [Thu, 20 Nov 2025 12:32:42 +0000 (13:32 +0100)] 
chg: usr: Reduce the number of outgoing queries

Reduces the number of outgoing queries when resolving the nameservers
for delegation points.  This helps the DNS resolver with cold cache
resolve client queries with complex delegation chains and redirections.

Merge branch 'ondrej/fctx_getaddresses' into 'main'

See merge request isc-projects/bind9!11148

5 months agoRefactor fctx_getaddresses() into couple smaller functions
Ondřej Surý [Wed, 19 Nov 2025 07:57:09 +0000 (08:57 +0100)] 
Refactor fctx_getaddresses() into couple smaller functions

The fctx_getaddresses() was lengthy and little bit confusing with
goto statements.  Split the single function into smaller parts:
one for forwarders, one for nameservers and one for alternates.

5 months agoReduce the number of outgoing queries
Ondřej Surý [Thu, 23 Oct 2025 11:11:45 +0000 (13:11 +0200)] 
Reduce the number of outgoing queries

The dns_resolver mode of operation is to resolve all the domains as it
iterates the DNS tree to fill up the cache as quickly as possible.

This commit reduces the number of outgoing queries by reducing the
number of remote fetches started for the nameserver addresses resolution
via dns_adb_createfind() to a smaller number per depth of the recursion
since the delegation point (3 2 1 0) - where 0 means only create fetch
on demand if we don't have any addresses yet.

5 months agofix: usr: AMTRELAY type 0 presentation format handling was wrong
Mark Andrews [Thu, 20 Nov 2025 08:46:10 +0000 (19:46 +1100)] 
fix: usr: AMTRELAY type 0 presentation format handling was wrong

RFC 8777 specifies a placeholder value of "." for the gateway field when the
gateway type is 0 (no gateway).  This was not being checked for nor emitted
when displaying the record. This has been corrected.

Instances of this record will need the placeholder period added to them when upgrading.

Closes #5639

Merge branch '5639-fix-atmrelay-type-0-support' into 'main'

See merge request isc-projects/bind9!11240

5 months agoAMTRELAY type 0 presentation format handling was wrong
Mark Andrews [Fri, 14 Nov 2025 01:59:29 +0000 (12:59 +1100)] 
AMTRELAY type 0 presentation format handling was wrong

RFC 8777 specifies a placeholder value of "." for the gateway field
when the gateway type is 0 (no gateway).

5 months agofix: dev: Fix building on OpenBSD 7.8 with Clang 19.1.7
Mark Andrews [Thu, 20 Nov 2025 02:40:11 +0000 (13:40 +1100)] 
fix: dev: Fix building on OpenBSD 7.8 with Clang 19.1.7

Add the OpenBSD and Clang combination to the existing kludge to
recognize size_t and uintXX_t types as same when using a generic.

Closes #5635

Merge branch '5635-openbsd-size_t-generics-fix' into 'main'

See merge request isc-projects/bind9!11235

5 months agoFix building on OpenBSD 7.8 with Clang 19.1.7
Aram Sargsyan [Tue, 11 Nov 2025 13:49:14 +0000 (13:49 +0000)] 
Fix building on OpenBSD 7.8 with Clang 19.1.7

Add the OpenBSD and Clang combination to the existing kludge to
recognize size_t and uintXX_t types as same when using a generic.

5 months agofix: nil: Remove install_rpath from synthrecord plugin
Ondřej Surý [Wed, 19 Nov 2025 22:07:39 +0000 (23:07 +0100)] 
fix: nil: Remove install_rpath from synthrecord plugin

See 0a56c71865f60127f1d0ce4c0b6408f747cde846 for more details.

Merge branch 'ondrej/remove-rpath-from-synthrecord' into 'main'

See merge request isc-projects/bind9!11253

5 months agoRemove install_rpath from synthrecord plugin
Ondřej Surý [Wed, 19 Nov 2025 21:07:30 +0000 (22:07 +0100)] 
Remove install_rpath from synthrecord plugin

See 0a56c71865f60127f1d0ce4c0b6408f747cde846 for more details.

5 months agoMerge tag 'v9.21.15'
Michal Nowak [Wed, 19 Nov 2025 17:38:37 +0000 (17:38 +0000)] 
Merge tag 'v9.21.15'

5 months agofix: test: Include <stdarg.h> in byaddr_test.c
Mark Andrews [Wed, 19 Nov 2025 00:56:16 +0000 (11:56 +1100)] 
fix: test: Include <stdarg.h> in byaddr_test.c

Closes #5637

Merge branch '5637-include-stdarg-h-in-byaddr-test-c' into 'main'

See merge request isc-projects/bind9!11241

5 months agoInclude <stdarg.h> in byaddr_test.c
Mark Andrews [Fri, 14 Nov 2025 02:34:45 +0000 (13:34 +1100)] 
Include <stdarg.h> in byaddr_test.c

5 months agochg: dev: Remove exclusive mode when scheduling zone load
Colin Vidal [Tue, 18 Nov 2025 11:16:39 +0000 (12:16 +0100)] 
chg: dev: Remove exclusive mode when scheduling zone load

Remove exclusive mode when scheduling the zone load, as it is no longer necessary;
data that can be read or written by multiple threads are locked or atomic.

The detection of the post zone DB loading logic has been refactored
to take into account the fact that zone databases may be loaded before the
function scheduling the loads.

Merge branch 'colin/remove-exclusive-zone-load' into 'main'

See merge request isc-projects/bind9!11231

5 months agorefactor detection of zone DB load completion
Colin Vidal [Mon, 10 Nov 2025 14:14:44 +0000 (15:14 +0100)] 
refactor detection of zone DB load completion

Because the asynchronous loading logic expected all jobs to be scheduled
then to be run (because it used to be scheduled during the exclusive
mode) and because all jobs are scheduled on various threads, there were
random situations where load_zones() would return after the scheduled
DB zone loading actually ran. In such cases, the zl->refs ref counter
in view_loaded() wouldn't go down to 0 and the remaining task to do
once all zones were loaded was never called. In particular,
server->reload_status kept the NAMED_RELOAD_PENDING state.

This problem is fixed by handling zoneload_t as a ref-counted object,
shared between load_zones() and each instance of scheduled zone DB
loading. Its destructor function is actually the content of
view_loaded() in the case the zt->refs went to 0. This ensures a
correct post-loading routine to be called once the last load is done.

5 months agoharden configloading system test
Colin Vidal [Mon, 10 Nov 2025 11:07:18 +0000 (12:07 +0100)] 
harden configloading system test

The configloading system script attempts multiple `rndc
{reconfig,reload}` commands without ensuring the system left
exclusive mode; which normally raise an RNDC error as the server is
currently reloading already. This used to work because the request was
enqueued while the server was in exclusive mode, and was processed
after the server `reload_status` was reset to `NAMED_RELOAD_DONE`.

Due to the fact the exclusive mode is not retaken after
`apply_configuration()` by `load_zones()`, the scheduling of
pending tasks is changed and, regularly, the RNDC command sent by the
test is processed before `NAMED_RELOAD_DONE` is set. This is the same
kind of issue the views system tests had, solved by
`4b2dcb3128fbd5af4609a5a73aeeee1f93bde237`

Fix the problem by waiting for a log line matching the end of
the reloading phase.

5 months agoset `reload_status` to fail before logging it
Colin Vidal [Mon, 10 Nov 2025 12:11:05 +0000 (13:11 +0100)] 
set `reload_status` to fail before logging it

The `reload_status` is set to `NAMED_RELOAD_FAILED` after the log line is
printed about this change. Update `reload_status` first, to avoid
(unlikely) case where a test waiting for this log line would attempt a
RNDC reload query but it would be processed by `named` before the status
is updated.

5 months agoremove exclusive mode when scheduling zone load
Colin Vidal [Mon, 10 Nov 2025 08:49:06 +0000 (09:49 +0100)] 
remove exclusive mode when scheduling zone load

Remove the exclusive mode when scheduling the zone load right after
(re)loading `named` configuration, as there is no reason anymore to
schedule zone loading while the exclusive lock is held. Data which can
be read or written by multiple threads are locked or atomic.

5 months agochg: usr: Enforce bounds of prefetch configuration option
Colin Vidal [Tue, 18 Nov 2025 10:04:49 +0000 (11:04 +0100)] 
chg: usr: Enforce bounds of prefetch configuration option

The prefetch configuration option now enforces boundaries. The configuration (including when using `named-checkconf`) now fails if the trigger (first value) is above 10, and if the eligibility (second optional value) isn't at least six seconds greater than the trigger value.

Merge branch 'colin/prefetch-enforcebounds' into 'main'

See merge request isc-projects/bind9!11243

5 months agoenforces bounds of prefetch statement
Colin Vidal [Mon, 17 Nov 2025 11:33:48 +0000 (12:33 +0100)] 
enforces bounds of prefetch statement

The prefetch statement now enforces its bounds. The configuration
(including `named-checkconf`) now fails if the trigger (first value) is
above 10, or if the eligibility (second optional value) isn't at least
six seconds more than the trigger value.

5 months agochg: usr: Enforces the fact that catalog-zone can not be used in non IN views
Colin Vidal [Tue, 18 Nov 2025 09:08:57 +0000 (10:08 +0100)] 
chg: usr: Enforces the fact that catalog-zone can not be used in non IN views

Catalog-zones can't be used in a view which is not from the IN class.
This is now enforced as the server won't load (instead of loading
without the catalog-zone) if such configuration is detected. This
configuration error is now also caught by `named-checkconf`.

Merge branch 'colin/catz-enforce-non-in' into 'main'

See merge request isc-projects/bind9!11245

5 months agoenforces that catalog-zone can't be used in non IN views
Colin Vidal [Mon, 17 Nov 2025 16:00:27 +0000 (17:00 +0100)] 
enforces that catalog-zone can't be used in non IN views

Catalog-zones can't be used in view which are not from the IN class.
This is now enforced as the server won't load (instead of loading
without the catalog-zone). This configuration error is now also caught
by `named-checkconf`.

5 months agoremove need_hints parameters to configure_view
Colin Vidal [Mon, 17 Nov 2025 14:23:58 +0000 (15:23 +0100)] 
remove need_hints parameters to configure_view

The `configure_view()` `need_hints` is removed as it this function was
always called with the value `true`.

The `need_hints` wasn't even used in the function. The only thing it was
actually used was to throw a warning which can be done simply in an
`else` condition branch.

Moreoever, in the case of catalog zones and response-policy, it fixes a
possible bug that would affect root zones, as those wouldn't be reverted
back to their previous version in case of the view fails to load
(during a server reconfiguration).

5 months agofix: nil: Add showconf in RNDC usage
Colin Vidal [Tue, 18 Nov 2025 09:07:20 +0000 (10:07 +0100)] 
fix: nil: Add showconf in RNDC usage

The `rndc -h` command was missing the newly introduced `showconf`
commands. Adding it.

Merge branch 'colin/fix-rndc-usage' into 'main'

See merge request isc-projects/bind9!11246

5 months agoadd showconf in RNDC usage
Colin Vidal [Tue, 18 Nov 2025 08:23:10 +0000 (09:23 +0100)] 
add showconf in RNDC usage

The `rndc -h` command was missing the newly introduced `showconf`
commands. Adding it.

5 months agochg: dev: No effective config as text if allow-new-zones is yes
Colin Vidal [Tue, 18 Nov 2025 08:16:57 +0000 (09:16 +0100)] 
chg: dev: No effective config as text if allow-new-zones is yes

Do not save the text version of the effective configuration when
`allow-new-zones` is enabled, as in that case the object tree can
be printed on demand, reducing unnecessary memory consumption.

Merge branch 'colin/no-effective-config-as-text-allownewzones' into 'main'

See merge request isc-projects/bind9!11242

5 months agono effective config as text if allow-new-zones is yes
Colin Vidal [Mon, 17 Nov 2025 10:06:34 +0000 (11:06 +0100)] 
no effective config as text if allow-new-zones is yes

Do not save the textual version of the effective configuration when
`allow-new-zones` is enabled, as it can be printed on-demand. This
enable to reduce the memory footprint of ~70MB on huge configurations
(1M zones).

6 months agofix: dev: Remove holes in `dns_zoneflg_t` enum
Colin Vidal [Thu, 13 Nov 2025 14:33:02 +0000 (15:33 +0100)] 
fix: dev: Remove holes in `dns_zoneflg_t` enum

The `dns_zoneflg_t` enum defined multiple possible flags for a zone, but
contains numerous holes (likely from flag removed in the past). This
fixes the holes, and use a bit-shift and decimal notation to make holes
easier to spot.

Merge branch 'colin/remove-zoneflag-holes' into 'main'

See merge request isc-projects/bind9!11189

6 months agoremove holes in `dns_zoneflg_t` enum
Colin Vidal [Fri, 31 Oct 2025 09:32:53 +0000 (10:32 +0100)] 
remove holes in `dns_zoneflg_t` enum

`dns_zoneflg_t` enum defined multiple possible flags for a zone, but
contains numerous holes (likely from flag removed in the past). This
fixes the holes, and use a bit-shift and decimal notation to make holes
easier to spot.

6 months agofix: dev: Save configuration as text
Colin Vidal [Wed, 12 Nov 2025 10:40:33 +0000 (11:40 +0100)] 
fix: dev: Save configuration as text

A `cfg_obj_t` object tree structure takes up considerably more space than the equivalent canonical text. If `allow-new-zones` is disabled and catalog zones are not in use, then we don't need the object tree. By storing the configuration in text format, we can use less memory, and `rndc showconf` and `rndc showzone` still work.

Merge branch 'each-cfg-as-text' into 'main'

See merge request isc-projects/bind9!11236

6 months agosave effective configuration as text
Evan Hunt [Wed, 12 Nov 2025 02:50:23 +0000 (18:50 -0800)] 
save effective configuration as text

the effective configuration tree is now detached if allow-new-zones
or catalog-zones aren't enabled in any views. this reduces memory
consumption while still allowing "rndc showconf -effective" to work.

6 months agosave zone configuration as text
Evan Hunt [Tue, 11 Nov 2025 23:46:23 +0000 (15:46 -0800)] 
save zone configuration as text

as previously mentioned in commit c65b2868ab, a cfg_obj_t
configuration tree structure takes up considerably more space than
the canonical text. since the zone configuration saved in the zone
object using dns_zone_setcfg() is only currently used for "rndc
showzone", it can be saved as text more efficiently than as an
object tree. (and, if a tree were needed, the text could be
re-parsed quickly; zone configuration text is generally small.)

6 months agonew: dev: Add spatch to detect implicit bool/int/result cast
Colin Vidal [Wed, 12 Nov 2025 10:31:37 +0000 (11:31 +0100)] 
new: dev: Add spatch to detect implicit bool/int/result cast

Detection of implicit cast from a boolean into an int, or an
isc_result_t into a boolean (either in an assignement or return
position).

If such pattern is found, a warning comment is added into the code (and
the CI will fails) so the error can be spotted and manually fixed.

Merge branch 'colin/cocci-detect-iscresult-int-implicit-casts' into 'main'

See merge request isc-projects/bind9!11095

6 months agocheck-cocci fails in WARNING is found on stderr
Colin Vidal [Wed, 15 Oct 2025 13:35:59 +0000 (15:35 +0200)] 
check-cocci fails in WARNING is found on stderr

As the implicit cast check print "WARNING: ..." on stderr, add a pattern
to make sure that check-cocci would fails if such warning is found on
stderr. This is generic (not specific like the existing "parse error")
so it should be able to support future Coccinelle spatch warnings.

6 months agomdig: fix implicit bool to int cast
Colin Vidal [Tue, 14 Oct 2025 11:31:44 +0000 (13:31 +0200)] 
mdig: fix implicit bool to int cast

The `display_rrcomments` is a tri-state (-1, 0, 1) which is (in some
cases) initialized with `state`, a boolean, through an implicit cast.
This was spot by Coccinelle. Remove the implcit cast by explicitly
assigning 0 or 1 to `display_rrcomments` based on `state` value.

6 months agoadd spatch to detect implicit bool/int/result cast
Colin Vidal [Tue, 14 Oct 2025 10:45:21 +0000 (12:45 +0200)] 
add spatch to detect implicit bool/int/result cast

Detection of implicit cast from a boolean into an int, or an
isc_result_t into a boolean (either in an assignement or return
position).

If such pattern is found, a warning comment is added into the code (and
the CI will fails) so the error can be spotted and manually fixed.

6 months agonew: test: Add isctest.check.ede() helper for pytest
Nicki Křížek [Mon, 10 Nov 2025 15:21:52 +0000 (16:21 +0100)] 
new: test: Add isctest.check.ede() helper for pytest

Add a utility function to check for EDE codes present in the DNS
message. The primary benefit of this helper function is that it
handles the compatibility issues with different dnspython versions
and the actual test code doesn't have to deal with that any more.

Merge branch 'nicki/isctest-check-ede-helper' into 'main'

See merge request isc-projects/bind9!11182

6 months agoFix CI trigger for system test modications
Nicki Křížek [Fri, 7 Nov 2025 10:30:23 +0000 (11:30 +0100)] 
Fix CI trigger for system test modications

Use bin/tests/system/**/* to detect changes to files not just directly
inside the directory, but also all of its subdirectories.

See https://docs.gitlab.com/ci/yaml/#ruleschanges

6 months agoUse new EDE helper in existing system tests
Nicki Křížek [Thu, 30 Oct 2025 17:12:25 +0000 (18:12 +0100)] 
Use new EDE helper in existing system tests

Previously, hasattr("extended_errors") was used as a check to detect a
mimumum required dnspython version in order to only perform the EDE
check if a new-enough dnspython was present. This is now abstracted into
isctest.check.ede().

In order to support dnspython<2.2.0, use isctest.compat.EDECode rather
than using dns.edns.EDECode directly.

6 months agoAdd isctest.check.ede() helper for pytest
Nicki Křížek [Thu, 30 Oct 2025 17:08:01 +0000 (18:08 +0100)] 
Add isctest.check.ede() helper for pytest

Add a utility function to check for EDE options present in the DNS
message. The primary benefit of this helper function is that it
handles the compatibility issues with different dnspython versions
and the actual test code doesn't have to deal with that any more.

Rather than using the convenience .extended_errors() method
introduced in dnspython 2.7.0, iterate over the options and find
EDEOption types, which is supported from 2.2.0 onwards.

To work around the issue of using dns.edns.EDECode to specify EDE codes
in our tests, create an isctest.compat.EDECode wrapper. This can be used
even with dnspython versions prior to 2.2.0 and will simply result in
no-op, since EDE isn't supported in the older dnspython anyway.

6 months agorem: nil: Remove maybe_cancel_validators() function
Ondřej Surý [Sat, 8 Nov 2025 23:37:23 +0000 (00:37 +0100)] 
rem: nil: Remove maybe_cancel_validators() function

When shutting down an fctx, validators can just be canceled
without checking whether there are pending finds.

Merge branch 'ondrej/remove-maybe_cancel_validators' into 'main'

See merge request isc-projects/bind9!11229

6 months agoRemove maybe_cancel_validators() function
Evan Hunt [Sat, 25 Oct 2025 00:01:14 +0000 (17:01 -0700)] 
Remove maybe_cancel_validators() function

When shutting down an fctx, validators can just be canceled
without checking whether there are pending finds.

6 months agofix: test: Rewrite views/addzone in loop system test
Colin Vidal [Fri, 7 Nov 2025 14:46:15 +0000 (15:46 +0100)] 
fix: test: Rewrite views/addzone in loop system test

A part of the `views` system test attempts to add multiples zones in a
loop, and after each zone being added, reconfig the server.

However, the test didn't take into account the fact that the server
might take a bit more time to reload than the script to move to the next
iteration, and in some case the test was re-requesting the server reload
when it was still reloading.

Since `b49f83a3`, `named` explicitly fails to reload when a load/reload
is pending, which is (unless proved otherwise) the reason of the test
was now randomly failing.

That part of the test is now waiting for the server log message saying
the server has added the new zone and is running. Also, that part of the
test has been rewrote in Python.

Closes #5617

Merge branch '5617-rewrite-reload-view-test' into 'main'

See merge request isc-projects/bind9!11225

6 months agorewrite views/addzone in loop system test
Colin Vidal [Fri, 7 Nov 2025 09:45:09 +0000 (10:45 +0100)] 
rewrite views/addzone in loop system test

A part of the `views` system test attempts to add multiples zones in a
loop, and after each zone being added, reconfig the server.

However, the test didn't take into account the fact that the server
might take a bit more time to reload than the script to move to the next
iteration, and in some case the test was re-requesting the server reload
when it was still reloading.

Since `b49f83a3`, `named` explicitly fails to reload when a load/reload
is pending, which is (unless proved otherwise) the reason of the test
was now randomly failing.

That part of the test is now waiting for the server log message saying
the server has added the new zone and is running. Also, that part of the
test has been rewrote in Python.

6 months agoUpdate BIND version for release v9.21.15
Michal Nowak [Fri, 7 Nov 2025 09:34:27 +0000 (10:34 +0100)] 
Update BIND version for release

6 months agonew: doc: Prepare documentation for BIND 9.21.15
Michal Nowak [Fri, 7 Nov 2025 09:20:54 +0000 (10:20 +0100)] 
new: doc: Prepare documentation for BIND 9.21.15

Merge branch 'mnowak/prepare-documentation-for-bind-9.21.15' into 'v9.21.15-release'

See merge request isc-private/bind9!877

6 months agoDrop #5525 and fuzzing-related release notes
Michal Nowak [Thu, 6 Nov 2025 16:51:04 +0000 (17:51 +0100)] 
Drop #5525 and fuzzing-related release notes

6 months agoReorder release notes
Michal Nowak [Thu, 6 Nov 2025 16:49:38 +0000 (17:49 +0100)] 
Reorder release notes

6 months agoTweak and reword release notes
Michal Nowak [Thu, 6 Nov 2025 11:23:11 +0000 (12:23 +0100)] 
Tweak and reword release notes

6 months agofix: test: Harden EDE 24 system tests
Colin Vidal [Thu, 6 Nov 2025 15:13:29 +0000 (16:13 +0100)] 
fix: test: Harden EDE 24 system tests

Harden `ede24` system test in order to avoid random failures, likely caused by timing issues. Also remove expiration-related dead-code (which should have been done in the original ede24 changes) as well as printing the query ID, as this should be useful to debug further flaky system test issues. (In particular, this one, if the changes made here are not enough).

Closes #5625

Merge branch '5625-fix-ede24-test' into 'main'

See merge request isc-projects/bind9!11217

6 months agosplit ede24 system test into separate modules
Colin Vidal [Thu, 6 Nov 2025 13:35:33 +0000 (14:35 +0100)] 
split ede24 system test into separate modules

Because ede24 system tests require stopping/restarting server, there is
always the risk that the test ends (with a failure) with server in an
wrong and impredictible state. This would make the other tests to fail
in a strange way as well.

To avoid this problem, split the test into different modules, so if a
module fails, the other module is not impacted as it uses separate
server instances.

6 months agoharden ede24 system test
Colin Vidal [Wed, 5 Nov 2025 14:08:51 +0000 (15:08 +0100)] 
harden ede24 system test

There was a random failure of ede24 system test. While this is still a
bit speculative, the two reasons were:

- in the case of `test_ede24_noloaded` the test might attempt to early
  (before the zone actually transfered on the secondary server) to query
  ns2.

- still in the case of `test_ede24_noloaded`, even after waiting for
  transfer succeed logs, if the CI machine is slow, the zone could be
  expired before the request checking the secondary zone works because
  the expiration time of the zone was very short (1s). Moving this
  expiration time to 3 seconds should be enough (while not making the
  test execution too much longer when waiting for the zone expiration).

- in the case of `test_ede24_expired`, the zone expired flag is flipped
  and the log message is printed immediately after. However, it is
  possible that because the flag is set using a relaxed atomic
  operation, another thread process the query and gets the previous
  (non-expired) value of the flag. In order to workaround this, the
  test now also expects another log written after the zone expiration
  (stop timers) on the next UV tick.

6 months agoadd query ID to the query trace message
Colin Vidal [Wed, 5 Nov 2025 14:06:03 +0000 (15:06 +0100)] 
add query ID to the query trace message

Adding the query ID to the query trace message. The log is now as the
following (id is at the end):

    query client=0x7f75c5017000 thread=0x7f75c6dfe680(foo.fr/A): \
      client attr:0x22300, query attr:0x700, restarts:0, \
      origqname:foo.fr, timer:0, authdb:0, referral:0, id:21338

This should help debugging tests, in particular to quickly get a
specific query from the logs.

6 months agoremove dns_zone_expire dead code
Colin Vidal [Wed, 5 Nov 2025 13:57:33 +0000 (14:57 +0100)] 
remove dns_zone_expire dead code

Removing `dns_zone_expire` function which is never called (the zone
expiration is detected internally in `lib/dns/zone.c`).

6 months agochg: dev: Refactor zone fetch code
Matthijs Mekking [Thu, 6 Nov 2025 12:01:55 +0000 (12:01 +0000)] 
chg: dev: Refactor zone fetch code

There is code duplication between `keyfetch` and `nsfetch`, refactor to allow common code paths to differentiate between them. This is in preparation for support of generalized DNS notifications, that will require fetching DSYNC records.

Merge branch 'matthijs-refactor-zone-fetch' into 'main'

See merge request isc-projects/bind9!11176

6 months agoSchedule a zonefetch
Matthijs Mekking [Thu, 6 Nov 2025 09:41:50 +0000 (10:41 +0100)] 
Schedule a zonefetch

Scheduling and rescheduling a zonefetch is also similar.  Refactor into
zonefetch functions.  This also increments and decrements the zone's
internal reference counter in the same module, which may be less
confusing when reading the code.

6 months agoPrepare release notes for BIND 9.21.15
Michal Nowak [Thu, 6 Nov 2025 10:48:00 +0000 (11:48 +0100)] 
Prepare release notes for BIND 9.21.15

6 months agoGenerate changelog for BIND 9.21.15
Michal Nowak [Thu, 6 Nov 2025 10:45:48 +0000 (11:45 +0100)] 
Generate changelog for BIND 9.21.15

6 months agoFix comment in lib/ns/query.c
Matthijs Mekking [Tue, 4 Nov 2025 16:17:13 +0000 (17:17 +0100)] 
Fix comment in lib/ns/query.c

While renaming exit_check() to dns__zone_free_check() in lib/dns/zone.c,
a dead reference to exit_check() in the comments was found in
lib/ns/query.c.

6 months agoA unified way to verify the zone fetch
Matthijs Mekking [Fri, 31 Oct 2025 08:04:13 +0000 (09:04 +0100)] 
A unified way to verify the zone fetch

There is a lot of similarity when checking the completed fetch is legit.
Create a new function to verify the fetch and to reduce code
duplication.

6 months agoCount per fetch type
Matthijs Mekking [Thu, 30 Oct 2025 10:01:04 +0000 (11:01 +0100)] 
Count per fetch type

Track fetch counts per type in an array, rather than special named
variables within the zone structure.

6 months agoRefactor zone fetch code
Matthijs Mekking [Wed, 29 Oct 2025 13:02:45 +0000 (14:02 +0100)] 
Refactor zone fetch code

There is code duplication between keyfetch and nsfetch, refactor to
allow common code paths to differentiate between them.

6 months agoExport zone functions
Matthijs Mekking [Wed, 29 Oct 2025 14:30:46 +0000 (15:30 +0100)] 
Export zone functions

Make some zone functions available that we are going to need in the
zonefetch code.

6 months agochg: ci: Run system tests on all platforms on MR that touches system tests
Štěpán Balážik [Thu, 6 Nov 2025 09:08:30 +0000 (09:08 +0000)] 
chg: ci: Run system tests on all platforms on MR that touches system tests

Not doing this has lead to breakage caused by different dnspython
versions on different platforms only discovered in full nightly
pipelines.

Add a triggering rule for MRs changing code in bin/test/system.
Apply this rule to all nightly-only system test jobs.

Merge branch 'stepan/run-all-system-tests-on-system-test-change' into 'main'

See merge request isc-projects/bind9!11214

6 months agoRun system tests on all platforms on MR that touches system tests
Štěpán Balážik [Wed, 5 Nov 2025 10:19:04 +0000 (11:19 +0100)] 
Run system tests on all platforms on MR that touches system tests

Not doing this has lead to breakage caused by different dnspython
versions on different platforms only discovered in full nightly
pipelines.

Add a triggering rule for MRs changing code in bin/test/system.
Apply this rule to all nightly-only system test jobs.

6 months agochg: doc: Set up version for BIND 9.21.16
Michal Nowak [Wed, 5 Nov 2025 18:38:15 +0000 (19:38 +0100)] 
chg: doc: Set up version for BIND 9.21.16

Merge branch 'mnowak/set-up-version-for-bind-9.21.16' into 'main'

See merge request isc-projects/bind9!11218

6 months agoUpdate BIND version to 9.21.16-dev
Michal Nowak [Wed, 5 Nov 2025 18:32:17 +0000 (19:32 +0100)] 
Update BIND version to 9.21.16-dev

6 months agofix: dev: Fix parser test (missing string termination)
Colin Vidal [Wed, 5 Nov 2025 12:59:23 +0000 (13:59 +0100)] 
fix: dev: Fix parser test (missing string termination)

Compare only the dumped configuration as the `cfg_printx` does not NULL-terminate the configuration strings.

Merge branch 'colin/fix-parser-test' into 'main'

See merge request isc-projects/bind9!11215

6 months agoFix parser test (missing string termination)
Ondřej Surý [Wed, 5 Nov 2025 11:39:43 +0000 (12:39 +0100)] 
Fix parser test (missing string termination)

Parser test could crash because the `dumpb2` buffer hasn't explicit C
NULL string termination after dumping the configuration tree in it.
`cfg_printx` does not doing this by default.

Fix the test by comparing only the strings written with strncmp.

6 months agofix: test: Fix NSEC3HASH system test on jammy
Štěpán Balážik [Wed, 5 Nov 2025 11:54:23 +0000 (11:54 +0000)] 
fix: test: Fix NSEC3HASH system test on jammy

a94aab94404201a662c1e1d3e53cdeae0f5c8db5 removed importorskip call from
isctest.name on which the functionality of this test relied.

Add an explicit importorskip call to the test.

Merge branch 'stepan/fix-tools-nsec3hash-on-jammy' into 'main'

See merge request isc-projects/bind9!11213

6 months agoFix NSEC3HASH system test on jammy
Štěpán Balážik [Wed, 5 Nov 2025 09:51:26 +0000 (10:51 +0100)] 
Fix NSEC3HASH system test on jammy

a94aab94404201a662c1e1d3e53cdeae0f5c8db5 removed importorskip call from
isctest.name on which the functionality of this test relied.

Add an explicit importorskip call to the test.

6 months agofix: usr: Skip unsupported algorithms when looking for signing key
Ondřej Surý [Tue, 4 Nov 2025 19:30:08 +0000 (20:30 +0100)] 
fix: usr: Skip unsupported algorithms when looking for signing key

A mix of supported and unsupported DNSSEC algorithms in the same zone could have caused validation failures. Ignore the DNSSEC keys with unsupported algorithm when looking for the signing keys.

Closes #5622

Merge branch '5622-dont-fail-on-unsupported-algorithms' into 'main'

See merge request isc-projects/bind9!11208

6 months agoSkip unsupported algorithms when looking for signing key
Ondřej Surý [Tue, 4 Nov 2025 01:09:38 +0000 (02:09 +0100)] 
Skip unsupported algorithms when looking for signing key

When looking for a signing key in select_signing_key(), the result code
indicating unsupported algorithm would abort the search.  Instead, skip
such keys and continue searching for the right key.

Co-Authored-By: Aram Sargsyan <aram@isc.org>
Co-Authored-By: Petr Menšík <pemensik@redhat.com>
6 months agoAdd a system test with one good and one bad algorithm
Ondřej Surý [Sat, 1 Nov 2025 11:00:59 +0000 (12:00 +0100)] 
Add a system test with one good and one bad algorithm

The case where there would be one supported algorithm and one already
unsupported (like RSAMD5 or RSASHA1) was missing.

6 months agofix: dev: Only unlink from SIEVE LRU if it is still linked
Ondřej Surý [Tue, 4 Nov 2025 18:53:09 +0000 (19:53 +0100)] 
fix: dev: Only unlink from SIEVE LRU if it is still linked

Under the overmem conditions, the header could get unlinked from the
SIEVE LRU using a different path.  This could lead to double-unlink
which causes assertion failure.  Add a guard to ISC_SIEVE_UNLINK() to
unlink only still linked headers.

Closes #5606

Merge branch '5606-fix-assertion-failure-in-overmem-cleaning' into 'main'

See merge request isc-projects/bind9!11166