Commit graph

44767 commits

Author SHA1 Message Date
Colin Vidal
b40f92eb26 chg: dev: remove sigrdataset from dns_view_findzonecut()
Since the `sigrdataset` "output" parameter of `dns_view_findzonecut()` is never used (always called with NULL), it is now removed. As the resolver is moving towards a parent-centric direction, there is no point having a signature for the NS record (which is not authoritative in the parent, so never signed) when `dns_view_findzonecut()` is called.

Also, rename `dns_view_findzonecut()` as `dns_view_bestzonecut()` as it is used only in the context where the closest name servers for a name need to be queried and to avoid ambiguities with other code flows using `dns_db_findzonecut()`.

Merge branch 'colin/findzonecut-removesig' into 'main'

See merge request isc-projects/bind9!11444
2026-01-16 08:29:45 +01:00
Colin Vidal
e8b0d4749c rename dns_view_findzonecut() into dns_view_bestzonecut()
`dns_view_findzonecut()` is used only in the context where the closest
name servers for a name need to be queried.  In the future, this API
will also return the glues (if known) for those name servers, as well
as (exclusively, if both NS and DELEG exist) the DELEG record.

To avoid ambiguities with other code flows using `dns_db_findzonecut()`,
`dns_view_findzonecut()` has been renamed into `dns_view_bestzonecut()`.
2026-01-16 07:52:56 +01:00
Colin Vidal
18d6b94c1f remove sigrdataset from dns_view_findzonecut()
Since the `sigrdataset` "output" parameter of `dns_view_findzonecut()`
is never used (always called with NULL), it is now removed.

Also, since the resolver is moving towards a parent-centric direction,
there is no point having a signature for the NS record (which is not
authoritative in the parent, so never signed) in the contextes where
`dns_view_findzonecut()` is called.
2026-01-15 19:48:30 -08:00
Arаm Sаrgsyаn
9379ee2c1f fix: test: Fix a false positive compiler warning/error
When built with '-Doptimization=1', GCC produces a compiler warning:

    In file included from ../lib/isc/include/isc/lib.h:44,
                     from ../tests/dns/qp_test.c:26:
    ../tests/dns/qp_test.c: In function ‘check_predecessors_withchain’:
    ../lib/isc/include/isc/util.h:182:33: error: ‘ival’ may be used uninitialized [-Werror=maybe-uninitialized]
      182 |         (((a) == (b)) ? (void)0 : (_assert_int_equal(a, b, f, l), abort()))
          |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/cmocka.h🔢5: note: in expansion of macro ‘_assert_int_equal’
     1234 |     _assert_int_equal(cast_to_largest_integral_type(a), \
          |     ^~~~~~~~~~~~~~~~~
    ../tests/dns/qp_test.c:859:18: note: ‘ival’ was declared here
      859 |         uint32_t ival;
          |                  ^~~~

This is apparently a false positive, because the qpiter_prev_with_name()
function, when returning ISC_R_SUCCESS, sets the 'ival' (passed to
it by a pointer), and the caller checks that the return value is
ISC_R_SUCCESS before using 'ival'.

Initialize the 'ival' variable to 0 anyway to avoid the build error.

Closes #5704

Merge branch '5704-qp_test-uninitialized-false-positive-error-fix' into 'main'

See merge request isc-projects/bind9!11455
2026-01-15 17:50:33 +00:00
Aram Sargsyan
e2994d2b1a Fix a false positive compiler warning/error
When built with '-Doptimization=1', GCC produces a compiler warning:

    In file included from ../lib/isc/include/isc/lib.h:44,
                     from ../tests/dns/qp_test.c:26:
    ../tests/dns/qp_test.c: In function ‘check_predecessors_withchain’:
    ../lib/isc/include/isc/util.h:182:33: error: ‘ival’ may be used uninitialized [-Werror=maybe-uninitialized]
      182 |         (((a) == (b)) ? (void)0 : (_assert_int_equal(a, b, f, l), abort()))
          |         ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /usr/include/cmocka.h🔢5: note: in expansion of macro ‘_assert_int_equal’
     1234 |     _assert_int_equal(cast_to_largest_integral_type(a), \
          |     ^~~~~~~~~~~~~~~~~
    ../tests/dns/qp_test.c:859:18: note: ‘ival’ was declared here
      859 |         uint32_t ival;
          |                  ^~~~

This is apparently a false positive, because the qpiter_prev_with_name()
function, when returning ISC_R_SUCCESS, sets the 'ival' (passed to
it by a pointer), and the caller checks that the return value is
ISC_R_SUCCESS before using 'ival'.

Initialize the 'ival' variable to 0 anyway to avoid the build error.
2026-01-15 17:49:29 +00:00
Michal Nowak
0f7095f398 new: ci: Add minimal:gcc:trixie:amd64 jobs
Closes #5544 

Closes #5560

Merge branch '5544-add-gcc-minimal-amd64-jobs' into 'main'

See merge request isc-projects/bind9!11072
2026-01-15 14:31:15 +01:00
Michal Nowak
ea48200a72 Do not run unwritable dump-file check as root
When run as root, the "chmod -w" command is not an effective guard
against rndc dumping the DB to file.
2026-01-15 14:30:37 +01:00
Michal Nowak
e4cf76611e Add minimal:gcc:trixie:amd64 jobs 2026-01-15 14:30:37 +01:00
Michal Nowak
2a4355331a Fix forward ns4 when statistics-channels is disabled
With statistics-channels disabled, ns4 fails to start with:

    option 'statistics-channels' was not enabled at compile time
2026-01-15 14:30:37 +01:00
Michal Nowak
876060f3ef fix: test: Portions of two dnssec-malformed-dnskey tests need querytrace
Without querytrace set, test_malformed_ecdsa and test_multiple_rrsigs
fail on the log_validation_failed string.

Merge branch 'mnowak/dnssec-malformed-dnskey-needs-querytrace' into 'main'

See merge request isc-projects/bind9!11454
2026-01-15 14:07:25 +01:00
Michal Nowak
d03b3f5a1d
Portions of two dnssec-malformed-dnskey tests need querytrace
Without querytrace set, test_malformed_ecdsa and test_multiple_rrsigs
fail on the log_validation_failed string.
2026-01-15 13:03:19 +01:00
Štěpán Balážik
3011bb7a4e chg: test: Use isctest.asyncserver in the "ixfr" test
Merge branch 'stepan/ixfr-asyncserver' into 'main'

See merge request isc-projects/bind9!11403
2026-01-14 12:21:31 +00:00
Štěpán Balážik
46ecbbed0a Use isctest.asyncserver in the "ixfr" system test
Replace the usage of the `bin/tests/system/ans.pl` server with an
instance of ControllableAsyncServer.
2026-01-14 12:29:59 +01:00
Štěpán Balážik
2302fe1235 Add SwitchControlCommand for ControllableAsyncServer
To provide feature parity with `bin/tests/system/ans.pl` add a control
command to allow easy switching between different sequences of
ResponseHandlers.
2026-01-14 12:29:59 +01:00
Štěpán Balážik
7e587201a4 Use variadic positional parameters for plural install_* methods
It saves an indent and brackets on the call sites.

Also sort the handlers alphabetically where their order doesn't matter
and split the fallback handlers into a separate call to signify that
their position in the end matters.
2026-01-14 12:29:59 +01:00
Arаm Sаrgsyаn
96160298bd fix: usr: Make catalog zone names and member zones' entry names case-insensitive
Previously, the catalog zone names and their member zones' entry
names were unintentionally case-sensitive. This has been fixed.

Closes #5693

Merge branch '5693-catz-case-sensitivity-fix' into 'main'

See merge request isc-projects/bind9!11410
2026-01-12 12:59:35 +00:00
Aram Sargsyan
4e9d97b4f7 Test that catalog zones' entry names are case-insensitive 2026-01-12 12:58:57 +00:00
Aram Sargsyan
6f4b5d6958 Make catalog zones' entry names case-insensitive
Previously, the isc_ht hash table module was case-sensitive, but now
it supports case-insensitive mode. Use the case-insensitive mode
for the catalog zones' entry names.
2026-01-12 12:58:57 +00:00
Aram Sargsyan
6d0e6454ac Test that catalog zone names are case-insensitive
Change one of the existing catalog zone names to test that
catalog zones are now case-insensitive.
2026-01-12 12:58:57 +00:00
Aram Sargsyan
0e0ba06dbf Make catalog zone names case-insensitive
Previously, the isc_ht hash table module was case-sensitive, but now
it supports case-insensitive mode. Use the case-insensitive mode
for catalog zone names.
2026-01-12 12:58:57 +00:00
Nicki Křížek
3844a98782 chg: test: Replace digdelv ans.pl with AsyncDnsServer
Rewrite ans servers in digdelv test to use AsyncDnsServer.

Merge branch 'nicki/asyncdnsserver-digdelv' into 'main'

See merge request isc-projects/bind9!11308
2026-01-12 11:51:00 +01:00
Nicki Křížek
9b63187a99 Renumber ans7->ans6 and ans8->ans7 in digdelv test
Since there was no 10.53.0.6 server in the test, renumber the remaining
ones so that there's no gap in the server names.

This commit simply moves the ans.py files without any changes and
renumbers the IP addresses in tests.
2026-01-12 11:09:14 +01:00
Nicki Křížek
6c69abf783 Add dnspython>=2.0.0 requirement for digdelv
Now that the test uses AsyncDnsServer, require the appropriate dnspython
version for the test.
2026-01-12 11:08:31 +01:00
Nicki Křížek
0b7a089c7f Replace digdelv/ans8 with AsyncDnsServer
Previously, the ans8 server had different response modes that applied to
all queries. Replace it with AsyncDnsServer that has serves the different
response modes under different domains without the need to change the
server behaviour at runtime.

Add the new queries that require an ns3 fallback to the ns3/example.db
zone.
2026-01-12 11:08:26 +01:00
Nicki Křížek
575f0e3916 Replace digdelv/ans5 with ControllableAsyncDnsServer
The server has three modes of operation - either no response, a partial
AXFR or a complete AXFR. To test the fallback behaviour of dig, these
actions are be combined in a specific sequences. To set up the desired
server behaviour, use the _control queries for the server.
2026-01-12 11:08:26 +01:00
Nicki Křížek
20887ff80f Rename ResponseDropAndCloseConnection action
The action can be used to close the connection even after some response
was sent, depending on the ordering of actions in the handler that uses
it. Rename it to CloseConnection to use a more fitting name.
2026-01-12 11:08:26 +01:00
Nicki Křížek
c50a7d2de1 Replace digdelv/ans7 with AsyncDnsServer
ans7 server always replies with an UPDATE opcode in the message.
2026-01-12 11:08:22 +01:00
Nicki Křížek
648f2534b1 Replace digdelv/ans4 with AsyncDnsServer
Configure the AsyncDnsServer to ignore all queries to ensure the same
behaviour as with "//" command for ans.pl.
2026-01-12 11:05:48 +01:00
Nicki Křížek
3a6b977a92 Remove unused digdelv/ans6 server
This server receives no queries during the test and doesn't affect the
test outcome.
2026-01-12 11:05:48 +01:00
Štěpán Balážik
0d9facb4bc chg: test: Avoid sending manually created responses in asyncserver
If at all possible, all the responses should be created by
AsyncDnsServer's internal methods. To ensure this, mark them with a
magic attribute and check it on send and crash the server if a manually
created response is detected.

Merge branch 'stepan/avoid-using-hand-rolled-responses-in-asyncserver' into 'main'

See merge request isc-projects/bind9!11420
2026-01-09 15:22:31 +00:00
Štěpán Balážik
1fc206556b Avoid sending manually created responses in asyncserver
If at all possible, all the responses should be created by
AsyncDnsServer's internal methods. To ensure this, mark them with a
magic attribute and check it on send and crash the server if a manually
created response is detected.

Fix the qmin test server which uses `make_response`.
2026-01-09 14:22:16 +00:00
Colin Vidal
263f54c9d1 chg: dev: Split and refactor dns_view_findzonecut()
The function `dns_view_findzonecut()` was previously a complex bit of code (multiple pages long with multiple gotos and mutating states) into a simpler main entry point making explicit the various steps and layers involved into the delegation lookup.

Separate helper functions are added for specific sub-tasks (lookup from the zones, from the cache, deciding which result to use if there are valid candidates from the zone or cache, etc.)

Finally, the range of result values returned by `dns_view_findzonecut()` is simplified and clearly specified. This simplifies a bit the callers code.

See #5681

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

See merge request isc-projects/bind9!11377
2026-01-08 21:01:22 +01:00
Colin Vidal
e0d7bddc6c simplify usage of dns_view_findzonecut()
As `dns_view_findzonecut()` only returns either ISC_R_SUCCESS or
DNS_R_NXDOMAIN, and since it automatically disassociates the rdatasets
in case of failure, some call sites are simplified.
2026-01-08 20:26:32 +01:00
Colin Vidal
0f121224ec findzonecut: helper function to choose zone or cache
When a delegation is found at a zone level, the cache is also looked up,
in case a more specific delegation is found. If it is, then the records
from the zone are disassociated and then associated with those from the
cache.

There is no return value, because even if the cache lookup fails, there
is a valid delegation from the zone, so this is a success either way.

The main function `dns_view_findzonecut()` is also strongly refactored,
as `findzonecut_zoneorcache()` allows a sequential flow between the
various DB lookup attempts, instead of jumping back to the begining of
the lookup code using `goto`.

From the caller's point of view, the API is slightly simplified: the
return value can only be ISC_R_SUCCESS (a delegation is found) or
DNS_R_NXDOMAIN (no delegation is found). Also, if no delegation is
found, this guarantees that the rdatasets passed as parameter are
disassociated.
2026-01-08 20:26:32 +01:00
Colin Vidal
e71b9e03a8 findzonecut: helper function for zone lookup
Move the zone lookup code into a separate helper function.

The main extra change here is the return codes. This helper function can
return 3 (and only those 3) values:

- ISC_R_SUCCESS: a delegation is found
- DNS_R_NXDOMAIN: no zone matches the qname
- ISC_R_NOTFOUND: a zone is found, but no delegation in the zone (this
  can be either because there is simply no delegation, or for other
  reasons, like, the zone DB is not loaded yet).

This enables the caller to make decisions about whether to attempt a
cache and/or hints lookup or not.
2026-01-08 20:26:32 +01:00
Colin Vidal
1b54ff1efb findzonecut: helper function for cache lookup
Extract the cache lookup implementation from `dns_view_findzonecut()`
into a separate helper function.

Also, when the cache result is not ISC_R_SUCCESS (which is the only
"success" value from the existing code in this case), the return value
is overriden to DNS_R_NXDOMAIN. This enables the caller (in follow-up
commit) to differentiate the case where a zone is found, but for
whatever reason, no delegation is in there, from the case where no zone
is found. Separating those cases enables the caller to know whether it
needs to hit the cache/hints or not.
2026-01-08 20:26:32 +01:00
Colin Vidal
1b68638448 findzonecut: helper function for hints lookup
Extract `view_dns_findzonecut()` hints lookup parts in a separate
helper function.
2026-01-08 20:26:32 +01:00
Alessio Podda
d0cec705ab chg: dev: Remove rrset-order cyclic from the default config, with shim
Currently we add an rrset-order cyclic statement to the default config.
Since the rrset-order allows matching a subset of all names, it must
be implemented with a comparison against a wildcard, and since
the statement applies per rrset, this can result in million of
comparisons per second on a busy authoritative server.

This commit removes rrset-order from the default config, but adds back
a code shim in query_setorder to preserve the previous behaviour.

Merge branch 'alessio/dont-set-order' into 'main'

See merge request isc-projects/bind9!11417
2026-01-08 15:32:23 +00:00
Alessio Podda
78588981df Remove rrset-order cyclic from the default config, with shim
Currently we add an rrset-order cyclic statement to the default config.
Since the rrset-order allows matching a subset of all names, it must
be implemented with a string comparison against a wildcard, and since
the statement applies per rrset, this can result in millions of
comparisons per second on a busy authoritative server.

This commit removes rrset-order from the default config, but adds back
a code shim in query_setorder to preserve the previous behaviour.
2026-01-08 14:43:04 +01:00
Nicki Křížek
76e23a7945 chg: doc: Set up version for BIND 9.21.18
Merge branch 'nicki/set-up-version-for-bind-9.21.18' into 'main'

See merge request isc-projects/bind9!11439
2026-01-08 10:38:43 +01:00
Nicki Křížek
ea648fbfb3 Update BIND version to 9.21.18-dev 2026-01-08 10:34:57 +01:00
Nicki Křížek
c49ee7907d chg: dev: Support compilation with cmocka 2.0.0+
The `assert_in_range()` function was deprecated in favor of
`assert_int_in_range()` and `assert_uint_in_range()`. Add compatibility
shims for cmocka<2.0.0 and use the new functions.

Closes #5699

Merge branch '5699-support-cmocka-2.0.0' into 'main'

See merge request isc-projects/bind9!11412
2026-01-07 11:12:50 +01:00
Nicki Křížek
6843a4bd9a Support compilation with cmocka 2.0.0+
The `assert_in_range()` function was deprecated in favor of
`assert_int_in_range()` and `assert_uint_in_range()`. Add compatibility
shims for cmocka<2.0.0 and use the new functions.
2026-01-07 10:38:45 +01:00
Evan Hunt
57ee4d1e1c chg: usr: Enforce bounds of multiple configuration options
The configuration options `edns-version`, `edns-udp-size`,
`max-udp-size`, `no-cookie-udp-size` and `padding` now enforce
boundaries. The configuration (including when using `named-checkconf`)
now fails if those options are set out of range.

Merge branch 'colin/multiple-options-strict-boundaries' into 'main'

See merge request isc-projects/bind9!11248
2026-01-07 07:02:22 +00:00
Colin Vidal
7bf04a9a4c update doc for strict boundaries check
Update documentation, removing the mention of statements being
implicitely "fixed" if they are defined out of range (for
`edns-version`, `edns-udp-size`, `max-udp-size`, `no-cookie-udp-size`
and `padding`) as the ranges are now enforced.
2026-01-07 07:01:59 +00:00
Colin Vidal
588de09145 add strict bound check tests
Add checkconf system test covering the strict boundary checks for
`edns-version`, `edns-udp-size`, `max-udp-size`, `no-cookie-udp-size`
and `padding`.
2026-01-07 07:01:59 +00:00
Colin Vidal
a67487a4ad remove implicit bounds fixes in server config
Now that the configuration options `edns-version`, `edns-udp-size`,
`max-udp-size`, `no-cookie-udp-size` and `padding` have strict boundaries
(configuration failing if they are not respected), remove configuration
loading code which implicitely raises or lowers them.
2026-01-07 07:01:59 +00:00
Colin Vidal
4cf2efc97a small refactor for max-query-restart in check.c
Use the `check_range_uint32()` function in `check.c` to test the
boundaries of `max-query-restart` instead of custom code.
2026-01-07 07:01:59 +00:00
Colin Vidal
fe326a8c2f enforce bounds of multiple configuration options
The configuration options `edns-version`, `edns-udp-size`,
`max-udp-size`, `no-cookie-udp-size` and `padding` now enforce
boundaries. The configuration (including when using `named-checkconf`)
now fails if those options are out of range.
2026-01-07 07:01:59 +00:00
Michal Nowak
e5496bb41e new: ci: Add FreeBSD 15.0
Merge branch 'mnowak/freebsd-15.0' into 'main'

See merge request isc-projects/bind9!11320
2026-01-06 22:43:52 +01:00