Commit graph

43806 commits

Author SHA1 Message Date
Ondřej Surý
369c8dc388 Clarify rrset-order random distribution
The randomized order of the records in the rrset is not uniform across
all permutations.  Clarify this in the documentation.
2025-09-03 08:50:40 +02:00
Mark Andrews
bdcb90f43c new: usr: Support for parsing HHIT and BRID records has been added
Closes #5444

Merge branch '5444-add-hhit-and-brid-records' into 'main'

See merge request isc-projects/bind9!10795
2025-09-03 10:47:37 +10:00
Mark Andrews
92621e6390 Add tests for BRID and HHIT 2025-09-03 10:05:13 +10:00
Mark Andrews
6b29da55fc Add support for parsing and displaying BRID rdata type 2025-09-03 10:05:13 +10:00
Mark Andrews
37041c3ec3 Add support for parsing and displaying HHIT rdata type 2025-09-03 10:05:13 +10:00
Mark Andrews
70757a47e6 fix: usr: RPZ canonical warning displays zone entry incorrectly
When an IPv6 rpz prefix entry is entered incorrectly the log
message was just displaying the prefix rather than the full
entry.  This has been corrected.

Closes #5491

Merge branch '5491-rpz-canonical-warning-displays-zone-entry-incorrectly' into 'main'

See merge request isc-projects/bind9!10890
2025-09-03 09:41:18 +10:00
Mark Andrews
76db9e276f Add non canonical form entry to trigger log message 2025-09-03 09:01:54 +10:00
Mark Andrews
283da99f02 RPZ canonical warning displays zone entry incorrectly
Do not insert a NUL into ip_str too early as the full value
is needed later.  Only insert the NUL immediately before
displaying just the prefix string.
2025-09-03 09:01:54 +10:00
Ondřej Surý
b0d3a36a0a rem: nil: Remove qname/qtype from dns_adb_createfind() call
Both qname and qtype arguments to dns_adb_createfind() were unused.
Remove both these arguments from the function prototype.

Merge branch 'ondrej/minor-dns_adb-cleanup' into 'main'

See merge request isc-projects/bind9!10918
2025-09-02 21:41:05 +02:00
Ondřej Surý
5b025d6e43
Remove qname/qtype from dns_adb_createfind() call
Both qname and qtype arguments to dns_adb_createfind() were unused.
Remove both these arguments from the function prototype.
2025-09-02 20:16:58 +02:00
Matthijs Mekking
085653d8b7 chg: test: Wait for rekey_done log in rollover system tests
Waiting for "keymgr: done" logs caused some manual-mode tests to fail intermittently. Waiting for "rekey done" logs should be more reliable.

Closes #5493

Merge branch '5493-algoroll-csk-step3-manual-unstable-test' into 'main'

See merge request isc-projects/bind9!10923
2025-09-02 13:03:08 +00:00
Matthijs Mekking
4141ae1275 Wait for rekey_done log in rollover system tests
Waiting for "keymgr: done" logs caused some manual-mode tests to fail
intermittently. Waiting for "rekey done" logs should be more reliable.
2025-09-02 14:28:48 +02:00
Alessio Podda
8e3e4a5c19 chg: dev: Lazily allocate fetch counter
The counter in ns_client_t is used to track the maximum number of
recursions in the resolver, but it is created unconditionally when
starting the client and deallocated when resetting it.

This commit defers the allocation of the counter till recursion needs to
actually happen, speeding up authoritative workloads in perflab by
1.5~2%.

Merge branch 'alessio/lazy-fetch-counter-alloc' into 'main'

See merge request isc-projects/bind9!10917
2025-09-02 09:57:30 +00:00
Alessio Podda
20a1583661 Lazily allocate fetch counter
The counter in ns_client_t is used to track the maximum number of
recursions in the resolver, but it is created unconditionally when
starting the client and deallocated when resetting it.

This commit defers the allocation of the counter till recursion needs to
actually happen, speeding up authoritative workloads in perflab by
1.5~2%.
2025-09-02 11:22:28 +02:00
Andoni Duarte
3762bf7fed new: test: Test another 'stale-answer-client-timeout 0' scenario
Add a test to check serve-stale with the 'stale-answer-client-timeout 0'
configuration option and with a delegation which is a CNAME to a auth
zone.

Closes #5372

Merge branch '5372-serve-stale-crash-on-insist-unreachable-test' into 'main'

See merge request isc-projects/bind9!10920
2025-09-02 08:50:18 +00:00
Aram Sargsyan
04ed44e7d7 Test another 'stale-answer-client-timeout 0' scenario
Add a test to check serve-stale with the 'stale-answer-client-timeout 0'
configuration option and with a delegation which is a CNAME to a auth
zone.
2025-09-02 08:07:15 +00:00
Michał Kępień
bed752f57f rem: usr: Obsolete the "tkey-domain" statement
Mark the ``tkey-domain`` statement as obsolete, since it has not had any
effect on server behavior since support for TKEY Mode 2 (Diffie-Hellman)
was removed (in BIND 9.20.0).

See #4204

Merge branch '4204-obsolete-tkey-domain' into 'main'

See merge request isc-projects/bind9!10798
2025-09-01 22:29:23 +02:00
Michał Kępień
805f1c0f65
Obsolete the "tkey-domain" statement
The "tkey-domain" statement has effectively been a no-op since commit
bd4576b3ce, which removed the only bit of
code using it: the logic implementing TKEY Mode 2 (Diffie-Hellman).

A subsequent cleanup commit, 885c132f4a,
also missed the opportunity to remove the "tkey-domain" statement
altogether.

Mark the "tkey-domain" statement as obsolete and remove all code and
documentation related to it.
2025-09-01 21:35:33 +02:00
Michał Kępień
c47e8edd09 rem: usr: Deprecate the "tkey-gssapi-credential" statement
The :any:`tkey-gssapi-keytab` statement allows GSS-TSIG to be set up in
a simpler and more reliable way than using the
:any:`tkey-gssapi-credential` statement and setting environment
variables (e.g. ``KRB5_KTNAME``). Therefore, the
:any:`tkey-gssapi-credential` statement has been deprecated;
:any:`tkey-gssapi-keytab` should be used instead.

For configurations currently using a combination of both
:any:`tkey-gssapi-keytab` *and* :any:`tkey-gssapi-credential`, the
latter should be dropped and the keytab pointed to by
:any:`tkey-gssapi-keytab` should now only contain the credential
previously specified by :any:`tkey-gssapi-credential`.

See #4204

Merge branch '4204-deprecate-tkey-gssapi-credential' into 'main'

See merge request isc-projects/bind9!10782
2025-09-01 21:33:33 +02:00
Michał Kępień
6de435c528
Deprecate the "tkey-gssapi-credential" statement
The "tkey-gssapi-keytab" statement enables GSS-TSIG to be set up in a
simpler and more reliable way than using the "tkey-gssapi-credential"
statement and setting environment variables (e.g. KRB5_KTNAME).

Mark the "tkey-gssapi-credential" statement as deprecated to eventually
only have one method for setting up GSS-TSIG in named.  Do not mention
"tkey-gssapi-credential" in the section of the ARM on dynamic updates.
2025-09-01 21:23:30 +02:00
Michal Nowak
3c0c66dc3e new: ci: Add Debian "trixie"
Merge branch 'mnowak/add-debian-trixie' into 'main'

See merge request isc-projects/bind9!10827
2025-09-01 17:05:34 +02:00
Michal Nowak
62ed25d7c0
Drop unused env variable SCANBUILD 2025-09-01 16:28:33 +02:00
Michal Nowak
2b793d3f14
scan-build does not need to wait for previous stages 2025-09-01 16:28:33 +02:00
Michal Nowak
bb26409f34
Make "trixie" the base image 2025-09-01 16:28:33 +02:00
Michal Nowak
840069856f
Move CI and QA tools from Debian "sid" to "trixie"
Debian "sid" is not a stable test bed and should be avoided.
2025-09-01 16:28:33 +02:00
Michal Nowak
263810e779
Add Debian "trixie" 2025-09-01 16:28:33 +02:00
Ondřej Surý
d468180fbe chg: nil: Refactoring in the qpcache and qpzone
- Remove double non-NULL guard around bindrdataset()
- Add DNS_SLABTOP_FOREACH macros
- Made add() function in qpcache a single pass

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

See merge request isc-projects/bind9!10879
2025-08-28 20:11:14 +02:00
Ondřej Surý
8dd99876b8
Always scan all the slab headers when adding new entry
The existing logic would always scan the headers if:
- adding negative cache entry that's NXDOMAIN or negative RRSIG
- adding positive cache entry
- the type doesn't exist in the node

As the rest is relatively minor - we only delete rrset from resolver
on broken chain and most negative entries don't exist in the case
anyway, it feels like the extra logic to decide whether we should do
full scan or not is just complicating things.

Remove the extra logic and always scan all the slabtop/slabheaders in
the node when adding new entry into the cache.
2025-08-28 19:28:56 +02:00
Ondřej Surý
37fa960bd5
Add few missing qpcache_hit() calls
There were couple of missing qpcache_hit() calls in qpcache.c:add()
function where existing data was better than the newly added header.
2025-08-28 19:28:56 +02:00
Ondřej Surý
7b7901494d
Refactoring in qpcache.c:add()
There were several consequtive foreach loops when adding new entry into
the cache.  Merge the multiple foreach loops into a single pass loop
with some effort and a lot of comments.
2025-08-28 19:28:55 +02:00
Ondřej Surý
e3c0a2a0fd
Add DNS_SLABTOP_FOREACH macros
Add foreach macros to iterate through the dns_slabtop_t
single-linked lists.
2025-08-28 19:28:55 +02:00
Ondřej Surý
c60bdbcf5c
Remove double non-NULL guard around bindrdataset()
The bindrdataset() already has a logic to skip the rest of the function
if the passed rdataset is NULL.  Remove the external guarding for
'addedrdataset' to simplify the code flow both from the zone and cache
databases.
2025-08-28 19:28:55 +02:00
Colin Vidal
bc5c9cf62b chg: dev: move handle to keystores from the view to zonemgr
This is a follow-up of !10895 where the keystore pointer was removed
from the zone (as not specific to the zone) and moved to the view. But
in order to avoid adding extra lifecycle dependencies from the zone to
the view, the keystore pointer is now moved to the zonemgr, which also
makes more sense as this is a global settings, and zonemgr wraps a bunch
of other global settings to be accessibles from the zones.

Because the zonemgr lifecycle is the same of the keystores (which are
both depending on named_g_server) this should be a safe change.

Merge branch 'colin/keystores-zonemgr' into 'main'

See merge request isc-projects/bind9!10901
2025-08-28 17:30:57 +02:00
Colin Vidal
26b397bd0f move handle to keystores from the view to zonemgr
This is a follow-up of !10895 where the keystore pointer was removed
from the zone (as not specific to the zone) and moved to the view. But
in order to avoid adding extra lifecycle dependencies from the zone to
the view, the keystore pointer is now moved to the zonemgr, which also
makes more sense as this is a global settings, and zonemgr wraps a bunch
of other global settings to be accessibles from the zones.

Because the zonemgr lifecycle is the same of the keystores (which are
both depending on named_g_server) this should be a safe change.
2025-08-28 16:52:28 +02:00
Ondřej Surý
53cfb29205 fix: dev: Add and use __attribute__((nonnull)) in dnssec-signzone.c
Clang 20 was spuriously warning about the possibility of passing a NULL file pointer
to `fprintf()`, which uses the 'nonnull' attribute. To silence the warning, the functions
calling `fprintf()` have been marked with the same attribute to assure that NULL can't be
passed to them in the first place.

Close #5487

Merge branch '5487-mark-passed-file-pointer-as-nonnull-in-dnssec-signzone' into 'main'

See merge request isc-projects/bind9!10888
2025-08-28 16:24:08 +02:00
Ondřej Surý
9e350c1774 Add and use __attribute__((nonnull)) in dnssec-signzone.c
Clang 20 is complaining about passing NULL to an argument with 'nonnull'
attribute.  Mark these two functions with the same attribute to assure
that these two function also don't accept NULL as an argument.
2025-08-28 16:23:59 +02:00
Ondřej Surý
40b7f5b7ba fix: dev: Ensure file descriptors 0-2 are in use
libuv expect file descriptors <= STDERR_FILENO are in use. otherwise,
it may abort when closing a file descriptor it opened.

Closes #5226

Merge branch 'main' into 'main'

See merge request isc-projects/bind9!10582
2025-08-28 10:56:29 +02:00
Petr Špaček
e415c5c996
Test command line tools without stdio fds
Testing all combinations seems unnecessary but is cheap.
I was too lazy to run this against all tools we have. nsupdate was
chosen because it is one of few tools which actually use stdin and the
original issue was reproducible even without any network communication,
which was not the case for simple dig invocation.

Sorry for new shell test but doing this in Python seemed very
complicated and fragile.
2025-08-28 08:16:06 +02:00
Thomas Abraham
5cfdbeba72
ensure file descriptors 0-2 are in use before using libuv
libuv expects file descriptors <= STDERR_FILENO are in use. otherwise,
it may abort when closing a file descriptor it opened.

See https://github.com/libuv/libuv/pull/4559

Closes #5226
2025-08-28 08:16:06 +02:00
Arаm Sаrgsyаn
bcca7a6834 fix: usr: Fix a catalog zone issue when having an unset 'default-primaries' configuration clause
A catalog zone with an unset ``default-primaries`` clause could cause
an unexpected termination of the :iscman:`named` process after two
reloading or reconfiguration commands. This has been fixed.

Closes #5494

Merge branch '5494-catz-crash-with-unset-default-primaries-and-double-reconfig' into 'main'

See merge request isc-projects/bind9!10896
2025-08-27 16:16:05 +00:00
Aram Sargsyan
40d040b7d5 Add a catalog zone with an unset 'default-primaries' to the catz test
And unset 'default-primaries' is causing an assertion failure after
two reload/reconfig commands. Add such a catalog zone to check the fix.
2025-08-27 15:01:02 +00:00
Aram Sargsyan
db36ae47d2 Fix a bug in configure_catz_zone()
When dns_catz_zone_add() returns ISC_R_EXISTS and there is no
'default-primaries' or 'default-masters', the ISC_R_EXISTS result
code doesn't get reset to ISC_R_SUCCESS, and the function returns
ISC_R_EXISTS instead of ISC_R_SUCCESS. Which means that the zone
is successfully added, but the caller assumes that the function has
failed.

Reset 'result' to ISC_R_SUCCESS when dns_catz_zone_add() returns
ISC_R_EXISTS (it's not an error condition).

Refactor the code go call dns_catz_zone_add() when all other error
conditions are already checked.
2025-08-27 15:01:02 +00:00
Petr Špaček
6a76b143a7 chg: doc: Clarify forward, stub, and static-stub zone usage
Merge branch 'pspacek/doc-forward-stub-zones' into 'main'

See merge request isc-projects/bind9!10417
2025-08-27 14:17:19 +00:00
Petr Špaček
e84b98a9fc Clarify forward, stub, and static-stub zone usage
Clarify that forwarding points to a resolver and stub to auths.
Add cross-links. Rewrite stub zone type description.
2025-08-27 14:12:58 +00:00
Ondřej Surý
af0594f482 chg: dev: Rewrite the bit rotate functions using __builtin or generic
In gcc 15, __builtin_stdc_rotate_{left,right} was added.  Use these
builtins when available otherwise rewrite the ISC_ROTATE_LEFT and
ISC_ROTATE_RIGHT using _Generic.

Merge branch 'ondrej/use-__builtin_stdc_rotate_left_right' into 'main'

See merge request isc-projects/bind9!10893
2025-08-27 11:53:13 +02:00
Ondřej Surý
e01151f729 Rewrite the bit rotate functions using __builtin or generic
In gcc 15, __builtin_stdc_rotate_{left,right} was added.  Use these
builtins when available otherwise rewrite the ISC_ROTATE_LEFT and
ISC_ROTATE_RIGHT using _Generic.
2025-08-27 11:53:05 +02:00
Colin Vidal
7e12c7de0b chg: dev: move keystores handle from the zone to the view
The list of keystores is owned by the single server object
(named_g_server), but dns_zone_t has a pointer into it in order to
preserve encapsulation (lib/dns won't link to bin/named for good
reasons).

However, getting the keystores from the zone uses the zone lock whereas
this is not needed (as the pointer value doesn't depends on the zone,
and is initialized only with the same named_g_server->keystores value);
also storing an extra pointer per zone is not needed; also, there was a
logic based on the zone->secure property which was not needed (as there
is only one keystore).

The keystores pointer is now accessible and lock-free at view level,
it also simplifies a bit the various zone configuration APIs (server.c,
zoneconf.c).

Merge branch 'colin/move-keystore-to-view' into 'main'

See merge request isc-projects/bind9!10895
2025-08-27 11:01:15 +02:00
Colin Vidal
529fd913db move keystores handle from the zone to the view
The list of keystores is owned by the single server object
(named_g_server), but dns_zone_t has a pointer into it in order to
preserve encapsulation (lib/dns won't link to bin/named for good
reasons).

However, getting the keystores from the zone uses the zone lock whereas
this is not needed (as the pointer value doesn't depends on the zone,
and is initialized only with the same named_g_server->keystores value);
also storing an extra pointer per zone is not needed; also, there was a
logic based on the zone->secure property which was not needed (as there
is only one keystore).

The keystores pointer is now accessible and lock-free at view level,
it also simplifies a bit the various zone configuration APIs (server.c,
zoneconf.c).
2025-08-27 10:25:20 +02:00
Ondřej Surý
72189af7bf fix: usr: Prevent spurious SERVFAILs for certain 0-TTL resource records
Under certain circumstances, BIND 9 can return SERVFAIL when updating
existing entries in the cache with new NS, A, AAAA, or DS records with 0-TTL.

Closes #5294

Merge branch '5294-preserve-ZEROTTL-on-cache-update' into 'main'

See merge request isc-projects/bind9!10897
2025-08-26 21:03:43 +02:00
Ondřej Surý
9f7ba584cf
Don't preserve cache entries if new TTL is smaller than existing
Under certain circumstances, cache entries with equivalent rdataset
might not get replaced.  Previously such entry would get preserved
regardless of the new TTL and expire time on the existing header would
get updated when the expire time was less than the expire time on the
existing header.  Change the logic to preserve the existing header only
if the new expire time is larger than the existing one and replace the
existing cache entry when the new expire time is less than the existing
one.

Co-authored-by: Jinmei Tatuya <jtatuya@infoblox.com>
2025-08-26 18:26:34 +02:00