]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
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 ago[9.21.16] fix: usr: Adding NSEC3 opt-out records could leave invalid records in chain
Andoni Duarte [Tue, 9 Dec 2025 12:17:57 +0000 (12:17 +0000)] 
[9.21.16] fix: usr: Adding NSEC3 opt-out records could leave invalid records in chain

When creating an NSEC3 opt-out chain, a node in the chain could be removed too soon, causing the previous NSEC3 being unable to be found, resulting in invalid NSEC3 records to be left in the zone. This has been fixed.

Closes isc-projects/bind9#5671

Backport of isc-projects/bind9!11328

Merge branch '5671-fix-dbiterator-prev-9.21.16' into 'v9.21.16-release'

See merge request isc-private/bind9!891

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 agoIn dns_qpiter_{prev,next}, defer dereference_iter_node call
Ondřej Surý [Fri, 5 Dec 2025 11:29:32 +0000 (12:29 +0100)] 
In dns_qpiter_{prev,next}, defer dereference_iter_node call

dns_qpiter_{prev,next} requires the current iterator node to still be
valid which might not always the case after dereference_iter_node was
called.  Currently, this is ensured via closeversion() mechanism, but it
is not guaranteed to be true in the future.

Move the call to dereference_iter_node to after the dns_qpiter_prev()
and dns_qpiter_next() to prevent a possible use-after-free of the
current iterator node.

(cherry picked from commit 9914bd383ecd3f1dc1ed0a98171c79f0614988b3)

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.

5 months agoAdd generic isctest.run.EnvCmd helper to pytest
Nicki Křížek [Thu, 23 Oct 2025 10:36:56 +0000 (12:36 +0200)] 
Add generic isctest.run.EnvCmd helper to pytest

A generic helper that calls the environment-specified binaries in a
developer-friendly manner, i.e. passing arguments as strings rather than
having to split them first.

The isctest.run.cmd() remains as the basis which provides a clean and
robust interface, while the isctest.run.EnvCmd() can be used as a
convenient wrapper for tests, or when there are some shared default
parameters.

The isctest.run.Dig() is superseded with the isctest.run.EnvCmd(). In
the future, we might revisit adding Dig() or command-specific helpers
again, but it probably only makes sense if they offer command-aware
attributes / methods, rather than just being shortcuts to
isctest.run.EnvCmd().

5 months agoAdd pylint check for re.compile() alias
Nicki Křížek [Tue, 21 Oct 2025 16:58:26 +0000 (18:58 +0200)] 
Add pylint check for re.compile() alias

Ensure that Re() is used consistently across our code base.

5 months agoImprove file handling in ksr test
Nicki Křížek [Thu, 2 Oct 2025 17:12:50 +0000 (19:12 +0200)] 
Improve file handling in ksr test

Refactor the file handling to write to a file directly when calling
isctest.run.cmd().

Refactor the existing code to use CmdResult rather than out and err
separately.

5 months agoUse Text with Grep support in isctest.run.cmd()
Nicki Křížek [Thu, 2 Oct 2025 16:14:13 +0000 (18:14 +0200)] 
Use Text with Grep support in isctest.run.cmd()

When commands are executed using the isctest.run.cmd() command, allow
the output to be Grep-able like logs and text files.

5 months agoRefactor LogFile into TextFile with Grep support
Nicki Křížek [Thu, 2 Oct 2025 15:06:25 +0000 (17:06 +0200)] 
Refactor LogFile into TextFile with Grep support

Add a new Grep-like interface which can be used for searching for
regular expressions in files. Replace the prior LogFile used for named
logs with the new TextFile interface.

5 months agoMove text-related operations into isctest.text module
Nicki Křížek [Thu, 2 Oct 2025 10:05:27 +0000 (12:05 +0200)] 
Move text-related operations into isctest.text module

Add a new module for working with text and keep the isctest.log.watchlog
module focused on its purpose. Move LogFile and LineReader into the new
module. Add compile_pattern() helper which will be useful in subsequent
commits.

5 months agoUse Re() for creating regular expressions
Nicki Křížek [Thu, 2 Oct 2025 09:47:56 +0000 (11:47 +0200)] 
Use Re() for creating regular expressions

It's a fairly common pattern to use regular expression in our tests.
Instead of using the fairly verbose re.compile(), import that function
as Re() instead to allow for more brevity in the test syntax.

5 months agoUse CmdResult to decode stdout/stderr from isctest.run.cmd()
Nicki Křížek [Wed, 1 Oct 2025 15:53:18 +0000 (17:53 +0200)] 
Use CmdResult to decode stdout/stderr from isctest.run.cmd()

Avoid repeating the .decode("utf-8") snippet when processing command
output and provide a helper instead, which leads to more concise code.

5 months agoUtilize nsX.rndc() helper
Nicki Křížek [Wed, 1 Oct 2025 14:35:45 +0000 (16:35 +0200)] 
Utilize nsX.rndc() helper

Remove the duplicated code and replace it with nsX.rndc() call.

5 months agofix: usr: Adding NSEC3 opt-out records could leave invalid records in chain
Ondřej Surý [Mon, 8 Dec 2025 09:20:19 +0000 (10:20 +0100)] 
fix: usr: Adding NSEC3 opt-out records could leave invalid records in chain

When creating an NSEC3 opt-out chain, a node in the chain could be removed too soon, causing the previous NSEC3 being unable to be found, resulting in invalid NSEC3 records to be left in the zone. This has been fixed.

Closes #5671

Merge branch '5671-fix-dbiterator-prev' into 'main'

See merge request isc-projects/bind9!11328

5 months agoIn dns_qpiter_{prev,next}, defer dereference_iter_node call
Ondřej Surý [Fri, 5 Dec 2025 11:29:32 +0000 (12:29 +0100)] 
In dns_qpiter_{prev,next}, defer dereference_iter_node call

dns_qpiter_{prev,next} requires the current iterator node to still be
valid which might not always the case after dereference_iter_node was
called.  Currently, this is ensured via closeversion() mechanism, but it
is not guaranteed to be true in the future.

Move the call to dereference_iter_node to after the dns_qpiter_prev()
and dns_qpiter_next() to prevent a possible use-after-free of the
current iterator node.

5 months agofix: usr: Missing unlock
Mark Andrews [Mon, 8 Dec 2025 08:39:21 +0000 (19:39 +1100)] 
fix: usr: Missing unlock

'kasp->lock' was not released before returning.  This could result in
named locking up if 'dns_keymgr_status' fails when 'rndc dnssec -status'
is called.

Closes #5675

Merge branch '5675-missing-unlock' into 'main'

See merge request isc-projects/bind9!11338

6 months agoMissing unlock
Mark Andrews [Sun, 7 Dec 2025 22:59:29 +0000 (09:59 +1100)] 
Missing unlock

'kasp->lock' was not released before returning.

6 months agochg: doc: Installing after building
Ondřej Surý [Sat, 6 Dec 2025 17:59:49 +0000 (18:59 +0100)] 
chg: doc: Installing after building

Added the required steps for installing after building.

Merge branch 'patch-3' into 'main'

See merge request isc-projects/bind9!11337

6 months agoAdded the required steps for installing after building
Paul Hoffman [Sat, 6 Dec 2025 17:00:23 +0000 (17:00 +0000)] 
Added the required steps for installing after building

6 months agochg: dev: Shrunk cfgobj down from 48 bytes to 40 bytes
Colin Vidal [Sat, 6 Dec 2025 08:25:26 +0000 (09:25 +0100)] 
chg: dev: Shrunk cfgobj down from 48 bytes to 40 bytes

Follow-up of 38ce2906 as the size of the `cfg_obj_t` can actually goes
down to 40 bytes "for free", by using bitfields to only use 31 bits for
the `line` field, so the remaining bit can be use to hold the `cloned`
state without paying the extra 8 bytes padding.

Merge branch 'colin/cfgobj-40bytes' into 'main'

See merge request isc-projects/bind9!11334

6 months agoshrunk cfgobj down from 48 bytes to 40 bytes
Colin Vidal [Fri, 5 Dec 2025 21:02:36 +0000 (22:02 +0100)] 
shrunk cfgobj down from 48 bytes to 40 bytes

Follow-up of 38ce2906 as the size of the `cfg_obj_t` can actually goes
down to 40 bytes "for free", by using bitfields to only use 31 bits for
the `line` field, so the remaining bit can be use to hold the `cloned`
state without paying the extra 8 bytes padding.

6 months agofix: doc: correct a double negative in the padding doc
Evan Hunt [Fri, 5 Dec 2025 22:31:43 +0000 (22:31 +0000)] 
fix: doc: correct a double negative in the padding doc

`padding` is incompatible with TSIG and SIG(0), not with "no" TSIG
and SIG(0).

Merge branch 'each-fix-padding-doc' into 'main'

See merge request isc-projects/bind9!11333

6 months agocorrect a double negative in the padding doc
Evan Hunt [Fri, 5 Dec 2025 18:46:15 +0000 (10:46 -0800)] 
correct a double negative in the padding doc

`padding` is incompatible with TSIG and SIG(0), not with "no" TSIG
and SIG(0).

6 months agochg: usr: Add Extended DNS Error 13 (Cached Error) support
Colin Vidal [Fri, 5 Dec 2025 22:28:36 +0000 (23:28 +0100)] 
chg: usr: Add Extended DNS Error 13 (Cached Error) support

Extended DNS Error 13 (Cached Error) is now returned when the server
answers a message from a cached SERVFAIL.

See RFC 8914 section 4.14.

See #1836

Merge branch '1836-sfcache-ede' into 'main'

See merge request isc-projects/bind9!11322

6 months agoadd tests for EDE 13 support
Colin Vidal [Thu, 4 Dec 2025 15:44:42 +0000 (16:44 +0100)] 
add tests for EDE 13 support

Add system test covering EDE 13 being added in the response in case of
SERVFAIL cache hits.

6 months agosupport EDE 13 (Cached Error)
Colin Vidal [Thu, 4 Dec 2025 15:42:11 +0000 (16:42 +0100)] 
support EDE 13 (Cached Error)

Extended DNS Error 13 (Cached Error) is now returned when the server
answers a message from a cached SERVFAIL.

See RFC 8914 section 4.14.

6 months agofix: usr: Make key rollovers more robust
Matthijs Mekking [Fri, 5 Dec 2025 12:07:39 +0000 (12:07 +0000)] 
fix: usr: Make key rollovers more robust

A manual rollover when the zone is in an invalid DNSSEC state causes predecessor keys to be removed too quickly. Additional safeguards to prevent this have been added. DNSSEC records will not be removed from the zone until the underlying state machine has moved back into a valid DNSSEC state.

Closes #5458

Merge branch '5458-safeguard-against-key-rollovers-when-in-invalid-state' into 'main'

See merge request isc-projects/bind9!10813

6 months agoFix statschannel system test
Matthijs Mekking [Mon, 4 Aug 2025 12:34:07 +0000 (14:34 +0200)] 
Fix statschannel system test

The manykeys test case relies on keys being removed. Make sure the
zone is fully signed with the keys that will stay, so the other keys
may be removed safely.

This means the expected number of signatures generated and refreshed
will change. The CDS and CDNSKEY RRset also need to be signed now.

Configure the test case with sig-signing-signatures 100, large enough
that the entire zone is processed in a single step.

6 months agoFix nsec3 system test
Matthijs Mekking [Mon, 4 Aug 2025 11:09:12 +0000 (13:09 +0200)] 
Fix nsec3 system test

The nsec3 system test has a couple of cases where the configured policy
changes the algorithm, effectively triggering an algorithm rollover. Fix
those cases to start in a valid DNSSEC state. Then fix the expected key
states, no longer should the old algorithm be removed immediately.

6 months agoFix autosign system test
Matthijs Mekking [Thu, 31 Jul 2025 15:41:11 +0000 (17:41 +0200)] 
Fix autosign system test

When creating keys, set Publish and Activate times so that keys will
be initialized as omnipresent. This way we start with a safe DNSSEC
state. In most cases at least, because some tests depend on special
key timings.

The ttl[1-4].example cases have become incorrect. With dnssec-policy
we require the TTL to match the dnskey-ttl from the policy.

The delzsk.example will have a ZSK removed from the zone. It also
requires that the DNSKEY RRset is already published. This means
that for the existing keys the, no longer "is now published"
messages will be logged.

The nsec-only.example and reconf.example zones are fixed to have a
correct matching policy.

This all means the expected count of log messages changes slightly.

6 months agoFix views system test
Matthijs Mekking [Thu, 31 Jul 2025 14:51:37 +0000 (16:51 +0200)] 
Fix views system test

This test case enables DNSSEC and has a mismatch in policy. Fix the
policy so that it matches the existing key set, and adjust the
expected answer count because no longer a new key is generated.

6 months agoMake keymgr state machine more robust
Matthijs Mekking [Thu, 31 Jul 2025 12:30:20 +0000 (14:30 +0200)] 
Make keymgr state machine more robust

If the keymgr state machine is in an invalid state, it tries to move
it self to a valid state. But when you do key rollovers during an
invalid state, and the next state is also an invalid state, the keymgr
will happily do the transition.

It would be good to not do key rollovers if there is not a KSK and ZSK
fully omnipresent. But also it would be good to safeguard against
unexpected transitions.

This commit does that by not moving things to unretentive (which is
the state where we would remove the corresponding record from the zone)
if the state machine is currently in an invalid state.

6 months agoRollover test case for rumoured zone signatures
Matthijs Mekking [Thu, 31 Jul 2025 12:25:22 +0000 (14:25 +0200)] 
Rollover test case for rumoured zone signatures

Test a manual rollover when zone signatures have not become omnipresent
yet. This should not immediately remove the predecessor key.

6 months agofix: doc: Fix sig-signing-* duplicate documentation
Matthijs Mekking [Fri, 5 Dec 2025 10:52:37 +0000 (10:52 +0000)] 
fix: doc: Fix sig-signing-* duplicate documentation

Merge branch 'matthijs-doc-sig-signing-options' into 'main'

See merge request isc-projects/bind9!11324

6 months agoFix sig-signing-* duplicate documentation
Matthijs Mekking [Fri, 5 Dec 2025 10:17:06 +0000 (11:17 +0100)] 
Fix sig-signing-* duplicate documentation

6 months agochg: dev: Shrunk cfgobj down from 72 bytes to 48 bytes
Colin Vidal [Fri, 5 Dec 2025 08:35:58 +0000 (09:35 +0100)] 
chg: dev: Shrunk cfgobj down from 72 bytes to 48 bytes

Make all non-scalar properties of `cfg_obj_t` allocated values, which
ensures the union size is the width of one pointer. Also reorder the
fields inside `cfg_obj_t` to avoid alignment padding that would increase
the size. As a result, a `cfg_obj_t` instance is now 48 bytes on a
64-bit platform.

Add a static assertion to avoid increasing the size of the struct by
mistake.

The function `parse_sockaddrsub` was taking advantage of the fact that
both sockaddr and sockaddrtls were in the same position, and used to
initialize the sockaddr field independently if this was a -tls one or
not. This doesn't work anymore now that all fields are allocated,
so it has been slightly rewritten to take both cases into account
separately.

Merge branch 'colin/cfgobj-48bytes' into 'main'

See merge request isc-projects/bind9!11239

6 months agoshrunk cfgobj down to 48bytes
Colin Vidal [Fri, 7 Nov 2025 13:58:36 +0000 (14:58 +0100)] 
shrunk cfgobj down to 48bytes

Make all non-scalar properties of `cfg_obj_t` allocated values, which
ensures the union size is the width of one pointer. Also reorder the
fields inside `cfg_obj_t` to avoid alignment padding that would increase
the size. As a result, a `cfg_obj_t` instance is now 48 bytes on a
64-bit platform.

Add a static assertion to avoid increasing the size of the struct by
mistake.

The function `parse_sockaddrsub` was taking advantage of the fact that
both sockaddr and sockaddrtls were in the same position, and used to
initialize the sockaddr field independently if this was a -tls one or
not. This doesn't work anymore now that all fields are allocated,
so it has been slightly rewritten to take both cases into account
separately.

6 months agochg: dev: Remove memory context form `cfg_obj_t`
Colin Vidal [Thu, 4 Dec 2025 15:42:42 +0000 (16:42 +0100)] 
chg: dev: Remove memory context form `cfg_obj_t`

Removes the `cfg_obj_t` memory context pointer, as the parser always uses `isc_g_mctx`. This simplifies the parser API/configuration tree API (no need to pass the memory context); and the `cfg_obj_t` size goes down from 80 bytes to 72 bytes.

While not directly related to the changes, also remove the `cfg_parser_t` `references` field as it is not used anymore (since the `cfg_obj_t` types doesn't reference it anymore).

Merge branch 'colin/remove-memctx-cfgobj' into 'main'

See merge request isc-projects/bind9!11199

6 months agodocument usage of BIND9 constructors/destructors
Colin Vidal [Thu, 4 Dec 2025 13:02:01 +0000 (14:02 +0100)] 
document usage of BIND9 constructors/destructors

Document the way `__attribute__((__constructor__))` and
`__attribute__((__destructor__))` must be used in BIND9 libraries in
order to avoid unexpected behaviors with other third-party libraries.

6 months agoremove --memstats from cfg_test
Colin Vidal [Fri, 7 Nov 2025 17:56:39 +0000 (18:56 +0100)] 
remove --memstats from cfg_test

The `--memstats` option from cfg_test is unused, and even if used, does
nothing because `--memstats` relies on `isc_mem_stats` which dump memory
pools statistics, which are not used at all for configuration.

Also, dropping the option avoid to add a parser API to get the memory
stats (as the parser now uses the global memory context).

6 months agoremove memory context from parser context
Colin Vidal [Tue, 4 Nov 2025 09:49:40 +0000 (10:49 +0100)] 
remove memory context from parser context

As the isccfg library now uses the global memory context, it is now
used directly instead of passing the parser context around to grab its
memory context.

Also remove the memory context from the parser, as well as from
`cfg_obj_t`, as it's now useless.

6 months agocfg_parse_ API doesn't need memory context
Colin Vidal [Tue, 4 Nov 2025 09:46:05 +0000 (10:46 +0100)] 
cfg_parse_ API doesn't need memory context

Because the parser now uses global memory context, the cfg_parse_* API
doesn't take a memory context anymore.

6 months agoremove `references` from cfg_parser_t
Colin Vidal [Wed, 26 Nov 2025 13:33:02 +0000 (14:33 +0100)] 
remove `references` from cfg_parser_t

The parser used to be referenced by `cfg_obj_t`, but not anymore.
Removing the reference counter from `cfg_parser_t`.

6 months agoparser: add cfg_string_create() API
Colin Vidal [Mon, 3 Nov 2025 16:24:22 +0000 (17:24 +0100)] 
parser: add cfg_string_create() API

The parser has a static function `create_string()` used
internally. But there was duplicate code to create a string node
in `namedconf.c`.  Instead of implementing the same logic twice,
`create_string()` is now publicly exposed as `cfg_string_create()`.

6 months agochg: doc: Set up version for BIND 9.21.17
Andoni Duarte [Thu, 4 Dec 2025 09:34:57 +0000 (09:34 +0000)] 
chg: doc: Set up version for BIND 9.21.17

Merge branch 'andoni/set-up-version-for-bind-9.21.17' into 'main'

See merge request isc-projects/bind9!11319

6 months agoUpdate BIND version to 9.21.17-dev
Andoni Duarte Pintado [Thu, 4 Dec 2025 08:57:25 +0000 (09:57 +0100)] 
Update BIND version to 9.21.17-dev

6 months agofix: dev: Standardize CHECK and RETERR macros
Evan Hunt [Thu, 4 Dec 2025 03:15:12 +0000 (03:15 +0000)] 
fix: dev: Standardize CHECK and RETERR macros

Previously, there were over 40 separate definitions of `CHECK` macros, of
which most used `goto cleanup`, and the rest `goto failure` or `goto out`.
There were another 10 definitions of `RETERR`, of which most were identical
to `CHECK`, but some simply returned a result code instead
of jumping to a cleanup label.

This has now been standardized throughout the code base: `RETERR` is for
returning an error code in the case of an error, and `CHECK` is for jumping
to a cleanup tag, which is now always called `cleanup`. Both macros are
defined in `isc/util.h`.

Merge branch 'each-check-and-cleanup' into 'main'

See merge request isc-projects/bind9!10472

6 months agouse a standard CLEANUP macro
Evan Hunt [Thu, 16 Oct 2025 22:05:01 +0000 (15:05 -0700)] 
use a standard CLEANUP macro

CLEANUP is a macro similar to CHECK but unconditional, jumping
to cleanup even if the result is ISC_R_SUCCESS. It is now used
in place of DST_RET, CLEANUP_WITH, and CHECK(<non-success constant>).

6 months agoadd coccinelle script
Evan Hunt [Fri, 13 Jun 2025 05:19:27 +0000 (22:19 -0700)] 
add coccinelle script

add a semantic patch to prevent (most) future uses of the
CHECK and RETERR patterns.

6 months agoRemove unreachable code
Mark Andrews [Wed, 8 Oct 2025 00:27:04 +0000 (11:27 +1100)] 
Remove unreachable code

Remove some code checking for return values that are not possible.

6 months agoUse isc_result_t more consistently
Mark Andrews [Thu, 18 Sep 2025 15:26:29 +0000 (17:26 +0200)] 
Use isc_result_t more consistently

Some functions to check private data when parsing keys previously
used integer return codes, and have been updated to use isc_result_t.

6 months agoRename isc_result_t ret; to isc_result_t result;
Mark Andrews [Thu, 18 Sep 2025 12:33:36 +0000 (14:33 +0200)] 
Rename isc_result_t ret; to isc_result_t result;

Standardize result variable naming by using 'result' in most places.

6 months agoswitch to RETERR where it wasn't being used
Evan Hunt [Fri, 13 Jun 2025 05:17:33 +0000 (22:17 -0700)] 
switch to RETERR where it wasn't being used

replace all instances of the pattern:

        result = <statement>
        if (result != ISC_R_SUCCESS) {
                return result;
        }

with:

        RETERR(<statement>);

6 months agoswitch to CHECK where it wasn't being used
Evan Hunt [Thu, 22 May 2025 00:13:44 +0000 (17:13 -0700)] 
switch to CHECK where it wasn't being used

replace all instances of the pattern:

        result = <statement>
        if (result != ISC_R_SUCCESS) {
                goto cleanup;
        }

with:

        CHECK(<statement>);

6 months agostandardize CHECK and RETERR macros
Evan Hunt [Wed, 21 May 2025 20:22:58 +0000 (13:22 -0700)] 
standardize CHECK and RETERR macros

previously, there were over 40 separate definitions of CHECK macros, of
which most used "goto cleanup", and the rest "goto failure" or "goto
out". there were another 10 definitions of RETERR, of which most were
identical to CHECK, but some simply returned a result code instead of
jumping to a cleanup label.

this has now been standardized throughout the code base: RETERR is for
returning an error code in the case of an error, and CHECK is for jumping
to a cleanup tag, which is now always called "cleanup". both macros are
defined in isc/util.h.

6 months agochg: dev: Add RRSIG if required as soon as they are found
Colin Vidal [Wed, 3 Dec 2025 15:26:22 +0000 (16:26 +0100)] 
chg: dev: Add RRSIG if required as soon as they are found

When EDNS DO flag (`dig +dnssec`) flag is set, an rdataset is allocated
to hold the RRSIG of an RR, if present in DB. However, this allocation
is not done if the zone DB is not considered as secure
(`dns_db_issecure() == false`). Changes this behaviour by allocating the
rdataset anyway, so the RRSIG can be associated in the answer section of
the response as soon it is found from the DB.

The fact we attach the rrsig potentially more often (though it probably
occurs in edge cases) doesn't seems to affect performance in any ways:

Merge branch 'colin/rrsig-nonsecure-db' into 'main'

See merge request isc-projects/bind9!11317

6 months agotest for RRSIG provided as soon as they are found
Colin Vidal [Tue, 2 Dec 2025 18:00:55 +0000 (19:00 +0100)] 
test for RRSIG provided as soon as they are found

Add a system test which checks that a server authoritative on zone which
is not fully signed (here, it is missing the DNSKEY records as well as the
RRSIG on the RR `b`) still return the RRSIG associated with an RR if
provided in the zone.

6 months agoadd RRSIG if required as soon as they are found
Colin Vidal [Tue, 2 Dec 2025 15:53:40 +0000 (16:53 +0100)] 
add RRSIG if required as soon as they are found

When EDNS DO flag (`dig +dnssec`) flag is set, an rdataset is allocated
to hold the RRSIG of an RR, if present in DB. However, this allocation
is not done if the zone DB is not considered as secure
(`dns_db_issecure() == false`). Changes this behaviour by allocating the
rdataset anyway, so the RRSIG can be associated in the answer section of
the response as soon it is found from the DB.

6 months agofix: test: Fix an issue with unreachable cache's unit test
Arаm Sаrgsyаn [Wed, 3 Dec 2025 10:16:08 +0000 (10:16 +0000)] 
fix: test: Fix an issue with unreachable cache's unit test

The isc_stdtime_now() function used by dns_unreachcache_find() to
check if the entry needs to be expired has a one-second resolution,
and the test sleeps for 1 second and then for the amount of the
expiration interval, which in a worst-case scenario can cause the
test to fail, because the entry was expected to be expired but it
wasn't. Sleep for 2 seconds instead of 1 to avoid the timing
resolution issue.

Closes #5601

Merge branch '5601-unreachable-cache-expire-test-fix' into 'main'

See merge request isc-projects/bind9!11224

6 months agoFix an issue with unreachable cache's unit test
Aram Sargsyan [Thu, 6 Nov 2025 11:33:41 +0000 (11:33 +0000)] 
Fix an issue with unreachable cache's unit test

The isc_stdtime_now() function used by dns_unreachcache_find() to
check if the entry needs to be expired has a one-second resolution,
and the test sleeps for 1 second and then for the amount of the
expiration interval, which in a worst-case scenario can cause the
test to fail, because the entry was expected to be expired but it
wasn't. Sleep for 2 seconds instead of 1 to avoid the timing
resolution issue.

6 months agofix: nil: Fix mislocated 'break;'
Mark Andrews [Tue, 2 Dec 2025 03:24:47 +0000 (14:24 +1100)] 
fix: nil: Fix mislocated 'break;'

Closes #5665

Merge branch '5665-miss-located-break' into 'main'

See merge request isc-projects/bind9!11311

6 months agoFix mislocated break
Mark Andrews [Mon, 1 Dec 2025 00:28:21 +0000 (11:28 +1100)] 
Fix mislocated break

6 months agonew: usr: Add +[no]showtruncated and +[no]showallmessages to dig
Mark Andrews [Mon, 1 Dec 2025 23:11:49 +0000 (10:11 +1100)] 
new: usr: Add +[no]showtruncated and +[no]showallmessages to dig

The dig option +showtruncated adds the ability to display
the truncated message before retrying the query over TCP.

The dig option +showallmessages add a short cut which is
the equivalent of "dig +qr +showbadcookie +showbadversion
+showtruncated".

Closes #5657

Merge branch '5657-add-showtruncated-to-dig' into 'main'

See merge request isc-projects/bind9!11275

6 months agoAdd +showallmessages to dig
Mark Andrews [Thu, 27 Nov 2025 04:22:44 +0000 (15:22 +1100)] 
Add +showallmessages to dig

This is equivalent to "dig +qr +showbadcookie +showbadversion
+showtruncated".

6 months agocheck that dig +showtruncated works
Mark Andrews [Tue, 25 Nov 2025 05:57:44 +0000 (16:57 +1100)] 
check that dig +showtruncated works

6 months agoAdd +[no]showtruncated to dig
Mark Andrews [Tue, 25 Nov 2025 05:05:07 +0000 (16:05 +1100)] 
Add +[no]showtruncated to dig

Adds the ability to display the truncated message before retrying
the query over TCP.

6 months agochg: doc: Update CVE checklist
Michał Kępień [Mon, 1 Dec 2025 13:43:23 +0000 (14:43 +0100)] 
chg: doc: Update CVE checklist

Account for the recent nomenclature change in the CVE checklist.

Add a placeholder for a link to an Earliest Notification draft for every
vulnerability handled.

Use consistent Markdown reference names for all URLs in the summary
table.  Provide a template for all URLs to indicate naming expectations.

Merge branch 'michal/update-cve-checklist' into 'main'

See merge request isc-projects/bind9!11313

6 months agoClean up URL templates in the summary table
Michał Kępień [Mon, 1 Dec 2025 13:31:39 +0000 (14:31 +0100)] 
Clean up URL templates in the summary table

Use consistent Markdown reference names for all URLs in the summary
table.  Provide a template for all URLs to indicate naming expectations.

6 months agoAdd Earliest Notification row to the summary table
Michał Kępień [Mon, 1 Dec 2025 13:31:39 +0000 (14:31 +0100)] 
Add Earliest Notification row to the summary table

Add a placeholder for a link to an Earliest Notification draft for every
vulnerability handled.

6 months agoReplace "ASN" with "EVN" in the CVE checklist
Michał Kępień [Mon, 1 Dec 2025 13:31:39 +0000 (14:31 +0100)] 
Replace "ASN" with "EVN" in the CVE checklist

Account for the recent nomenclature change in the CVE checklist.

6 months agochg: test: Wait for log zone_needdump is more reliable
Matthijs Mekking [Mon, 1 Dec 2025 13:17:59 +0000 (13:17 +0000)] 
chg: test: Wait for log zone_needdump is more reliable

Closes #5648

Merge branch '5648-need-dump-instead-of-sending-notifies' into 'main'

See merge request isc-projects/bind9!11265

6 months agoWait for log zone_needdump is more reliable
Matthijs Mekking [Thu, 20 Nov 2025 13:10:45 +0000 (14:10 +0100)] 
Wait for log zone_needdump is more reliable

In some cases we wait for the log message "sending notifies" before
proceeding with the test case. Notifies are rate limited. They are not
sent on every change to the zone. The "zone_needdump" messages happen on
every change.