]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
19 months agochg: test: Disable too-many/too-few pylint checks
Nicki Křížek [Thu, 17 Oct 2024 09:11:26 +0000 (09:11 +0000)] 
chg: test: Disable too-many/too-few pylint checks

Merge branch 'nicki/pylint-disable-too-few-too-many-checks' into 'main'

See merge request isc-projects/bind9!9626

19 months agoDisable too-many/too-few pylint checks
Nicki Křížek [Mon, 14 Oct 2024 12:44:06 +0000 (14:44 +0200)] 
Disable too-many/too-few pylint checks

Enforcing pylint standards and default for our test code seems
counter-productive. Since most of the newly added code are tests or is
test-related, encountering these checks rarely make us refactor the code
in other ways and we just disable these checks individually. Code that
is too complex or convoluted will be pointed out in reviews anyways.

19 months agofix: usr: 'Recursive-clients 0;' triggers an assertion
Mark Andrews [Thu, 17 Oct 2024 06:43:25 +0000 (06:43 +0000)] 
fix: usr: 'Recursive-clients 0;' triggers an assertion

BIND 9.20.0 broke `recursive-clients 0;`.  This has now been fixed.

Closes #4987

Merge branch '4987-fix-recursive-clients-0' into 'main'

See merge request isc-projects/bind9!9621

19 months agoAdd regression test for [GL #4987]
Mark Andrews [Mon, 14 Oct 2024 03:15:27 +0000 (14:15 +1100)] 
Add regression test for [GL #4987]

19 months agoFix recursive-clients 0
Mark Andrews [Mon, 14 Oct 2024 03:09:03 +0000 (14:09 +1100)] 
Fix recursive-clients 0

Setting recursive-clients 0 triggered an assertion in isc_quota_soft.
This has now been fixed.

19 months agoMerge tag 'v9.21.2'
Michal Nowak [Wed, 16 Oct 2024 15:49:36 +0000 (17:49 +0200)] 
Merge tag 'v9.21.2'

19 months agochg: test: Rewrite ksr system test to pytest
Matthijs Mekking [Wed, 16 Oct 2024 15:45:18 +0000 (15:45 +0000)] 
chg: test: Rewrite ksr system test to pytest

Merge branch 'matthijs-pytest-rewrite-ksr' into 'main'

See merge request isc-projects/bind9!9445

19 months agoRetry dnssec-verify in kasp test code
Matthijs Mekking [Tue, 15 Oct 2024 08:43:41 +0000 (10:43 +0200)] 
Retry dnssec-verify in kasp test code

It is possible that the zone is not yet fully signed because it is
signed in batches. Retry the AXFR and verify command a couple of times.

19 months agoAddress pylint issues
Nicki Křížek [Mon, 14 Oct 2024 12:49:38 +0000 (14:49 +0200)] 
Address pylint issues

19 months agoUse difflib rather than diff cmd
Nicki Křížek [Tue, 8 Oct 2024 13:02:37 +0000 (15:02 +0200)] 
Use difflib rather than diff cmd

19 months agoMove algorithm defaults to check_keys()
Nicki Křížek [Tue, 8 Oct 2024 12:33:37 +0000 (14:33 +0200)] 
Move algorithm defaults to check_keys()

19 months agoUse f-strings
Nicki Křížek [Tue, 8 Oct 2024 12:12:10 +0000 (14:12 +0200)] 
Use f-strings

19 months agoSimplify command invocation
Nicki Křížek [Tue, 8 Oct 2024 12:11:56 +0000 (14:11 +0200)] 
Simplify command invocation

19 months agoRemove unused isctest/kasp code
Nicki Křížek [Tue, 8 Oct 2024 12:10:50 +0000 (14:10 +0200)] 
Remove unused isctest/kasp code

19 months agoRename kasp function to check_*
Nicki Křížek [Tue, 8 Oct 2024 12:09:05 +0000 (14:09 +0200)] 
Rename kasp function to check_*

If a function is expected to assert / raise on failure (rather than
return boolean), its name should start with "check_".

19 months agoUse convenience wrappers for kasp key operations
Nicki Křížek [Mon, 7 Oct 2024 16:08:02 +0000 (18:08 +0200)] 
Use convenience wrappers for kasp key operations

19 months agoConvert ksr system test to pytest
Matthijs Mekking [Mon, 2 Sep 2024 15:36:47 +0000 (17:36 +0200)] 
Convert ksr system test to pytest

Move all test cases from tests.sh to tests_ksr.py. The only test that
is not moved is the check that key id's match expected keys. The
shell-based system test checks two earlier set environment variables
against each other that has become redundant in the pytest variant,
because we now check the signed key response against a list of keys
and for each key we take into account the timing metadata. So we
already ensure that each published key is in the correct key bundle.

19 months agoIntroduce pytest kasp library
Matthijs Mekking [Mon, 2 Sep 2024 15:51:32 +0000 (17:51 +0200)] 
Introduce pytest kasp library

Write initial pytest kasp library. This contains everything that is
required for testing Offline KSK functionality with pytest.

This includes:
- addtime: adding a value to a timing metadata
- get_timing_metdata: retrieve timing metadata from keyfile
- get_metadata/get_keystate: retrieve metadata from statefile
- get_keytag: retrieve keytag from base keyfile string
- get_keyrole: get key role from statefile
- dnskey_equals: compare DNSKEY record from file against a string
- cds_equals: compare CDS derived from file against a string
- zone_is_signed: wait until a zone is completely signed
- dnssec_verify: verify a DNSSEC signed zone with dnssec-verify
- check_dnssecstatus: check rndc dnssec -status output
- check_signatures: check that signatures for a given RRset are correct
- check_dnskeys: check that the published DNSKEY RRset is correct
- check_cds: check that the published CDS RRset is correct
- check_apex: check SOA, DNSKEY, CDNSKEY, and CDS RRset
- check_subdomain: check an RRset below the apex

19 months agoChange dnssec-ksr key sorting
Matthijs Mekking [Mon, 2 Sep 2024 15:48:22 +0000 (17:48 +0200)] 
Change dnssec-ksr key sorting

Sort keys on algorithm, then keytag. This is more convenient for
testing.

19 months agochg: dev: unify explicit fetching and libcrypto handling
Aydın Mercan [Wed, 16 Oct 2024 12:53:31 +0000 (12:53 +0000)] 
chg: dev: unify explicit fetching and libcrypto handling

Unify libcrypto initialization and explicit digest fetching in a single place.

It will remove the remaining implicit fetching and deduplicate explicit
fetching inside the codebase. Initialization has been moved in to ensure
OpenSSL cleanup is done only after fetched contextes are destroyed.

Merge branch 'aydin/libdns-explicit-fetch' into 'main'

See merge request isc-projects/bind9!9288

19 months agounify libcrypto and evp_md handling
Aydın Mercan [Thu, 8 Aug 2024 10:16:50 +0000 (13:16 +0300)] 
unify libcrypto and evp_md handling

Unify libcrypto initialization and explicit digest fetching in a single
place and move relevant code to the isc__crypto namespace instead of
isc__tls.

It will remove the remaining implicit fetching and deduplicate explicit
fetching inside the codebase.

19 months agorem: dev: Remove unused <openssl/hmac.h> headers from OpenSSL shims
Mark Andrews [Wed, 16 Oct 2024 04:54:09 +0000 (04:54 +0000)] 
rem: dev: Remove unused <openssl/hmac.h> headers from OpenSSL shims

The <openssl/hmac.h> header was unused and including the
header might cause build failure when OpenSSL doesn't have
Engines support enabled.

See https://fedoraproject.org/wiki/Changes/OpensslDeprecateEngine

Removes unused hmac includes after Remove OpenSSL Engine support
(commit ef7aba70) removed engine support.

Merge branch 'main-openssl-engine' into 'main'

See merge request isc-projects/bind9!9228

19 months agoRemove unused <openssl/hmac.h> headers from OpenSSL shims
Petr Menšík [Fri, 2 Aug 2024 23:28:36 +0000 (01:28 +0200)] 
Remove unused <openssl/hmac.h> headers from OpenSSL shims

The <openssl/hmac.h> header was unused and including the
header might cause build failure when OpenSSL doesn't have
Engines support enabled.

See https://fedoraproject.org/wiki/Changes/OpensslDeprecateEngine

Removes unused hmac includes after Remove OpenSSL Engine support
(commit ef7aba70726cff9afaaa8c7054098f84087ccf84) removed engine
support.

19 months agochg: test: Remove unused sbytes, stime, n, response, and rtime variables
Michal Nowak [Tue, 15 Oct 2024 17:53:46 +0000 (17:53 +0000)] 
chg: test: Remove unused sbytes, stime, n, response, and rtime variables

Merge branch 'mnowak/drop-unused-variables' into 'main'

See merge request isc-projects/bind9!9617

19 months agoAdd vulture
Michal Nowak [Wed, 2 Oct 2024 08:13:26 +0000 (10:13 +0200)] 
Add vulture

19 months agoRemove unused sbytes, stime, n, response, and rtime variables
Michal Nowak [Tue, 1 Oct 2024 14:07:14 +0000 (16:07 +0200)] 
Remove unused sbytes, stime, n, response, and rtime variables

19 months agochg: test: Rewrite tools system test to pytest
Michal Nowak [Tue, 15 Oct 2024 17:19:09 +0000 (17:19 +0000)] 
chg: test: Rewrite tools system test to pytest

Merge branch 'mnowak/pytest_rewrite_tools' into 'main'

See merge request isc-projects/bind9!9208

19 months agoRewrite tools system test to pytest
Michal Nowak [Wed, 31 Jul 2024 16:40:32 +0000 (18:40 +0200)] 
Rewrite tools system test to pytest

19 months agochg: ci: Allow re-try of unit tests on FreeBSD 14
Nicki Křížek [Tue, 15 Oct 2024 11:14:02 +0000 (11:14 +0000)] 
chg: ci: Allow re-try of unit tests on FreeBSD 14

The unit test doh_test tends do fail quite often due to exceeding run
time limit in the unit:clang:freebsd14:amd64 job. Use a retry on gitlab
level to alleviate the issue until a better fix is available.

Related #4924

Merge branch '4924-retry-doh_test-freebsd14' into 'main'

See merge request isc-projects/bind9!9578

19 months agoAllow re-try of unit tests on FreeBSD 14
Nicki Křížek [Tue, 1 Oct 2024 15:10:23 +0000 (17:10 +0200)] 
Allow re-try of unit tests on FreeBSD 14

The unit test doh_test tends do fail quite often due to exceeding run
time limit in the unit:clang:freebsd14:amd64 job. Use a retry on gitlab
level to alleviate the issue until a better fix is available.

19 months agochg: test: Support dnspython 2.7.0
Nicki Křížek [Tue, 15 Oct 2024 10:27:08 +0000 (10:27 +0000)] 
chg: test: Support dnspython 2.7.0

Closes #4988

Merge branch '4988-dnspython-2.7.0-support' into 'main'

See merge request isc-projects/bind9!9634

19 months agoSupport dnspython 2.7.0
Nicki Křížek [Tue, 15 Oct 2024 08:03:25 +0000 (10:03 +0200)] 
Support dnspython 2.7.0

CookieOption with new .server/.client attributes (rather than .data) was
added to dnspython. Adjust the code to use the new attributes if
available and fall back to the old code for dnspython<2.7.0
compatibility.

19 months agofix: usr: Fix NSEC3 closest encloser lookup for names with empty non-terminals
Mark Andrews [Mon, 14 Oct 2024 23:54:27 +0000 (23:54 +0000)] 
fix: usr: Fix NSEC3 closest encloser lookup for names with empty non-terminals

The performance improvement for finding the NSEC3 closest encloser when generating authoritative responses could cause servers to return incorrect NSEC3 records in some cases. This has been fixed.

Closes #4950

Merge branch '4950-bind-logs-expected-covering-nsec3-got-an-exact-match' into 'main'

See merge request isc-projects/bind9!9610

19 months agoTest that the correct NSEC3 closest encloser is returned
Mark Andrews [Thu, 10 Oct 2024 07:29:02 +0000 (18:29 +1100)] 
Test that the correct NSEC3 closest encloser is returned

19 months agoUse a binary search to find the NSEC3 closest encloser
Mark Andrews [Thu, 10 Oct 2024 05:39:10 +0000 (16:39 +1100)] 
Use a binary search to find the NSEC3 closest encloser

maxlabels is the suffix length that corresponds to the latest
NXDOMAIN response.  minlabels is the suffix length that corresponds
to longest found existing name.

19 months agofix: usr: Report client transport in 'rndc recursing'
Evan Hunt [Mon, 14 Oct 2024 21:16:27 +0000 (21:16 +0000)] 
fix: usr: Report client transport in 'rndc recursing'

When `rndc recursing` is used to dump the list of recursing clients, it now indicates whether a query was sent via UDP, TCP, TLS, or HTTP.

Closes #4971

Merge branch '4971-recursing-show-client-transport' into 'main'

See merge request isc-projects/bind9!9590

19 months agoadd a unit test for dns_transport_totext()
Evan Hunt [Sat, 12 Oct 2024 03:16:24 +0000 (20:16 -0700)] 
add a unit test for dns_transport_totext()

confirm that the text returned by the dns_transport_totext()
function matches the transport type when it was created.

19 months agocheck 'rndc recursing'
Evan Hunt [Sat, 12 Oct 2024 03:19:02 +0000 (20:19 -0700)] 
check 'rndc recursing'

there was no system test that exercised 'rndc recursing'; a
simple one has now been added; it confirms that the number of
recursing clients reported by 'rndc stats' is in agreement with
the list returned by 'rndc recursing'.

19 months agoreport client transport in 'rndc recursing'
Evan Hunt [Fri, 4 Oct 2024 02:51:20 +0000 (19:51 -0700)] 
report client transport in 'rndc recursing'

when dumping the list of recursing clients, indicate whether
a given query was sent over UDP, TCP, TLS, or HTTP.

19 months agofix: test: Always use requirements.txt from main
Michal Nowak [Mon, 14 Oct 2024 18:07:32 +0000 (18:07 +0000)] 
fix: test: Always use requirements.txt from main

Merge branch 'mnowak/update-util-release-tarball-comparison-sh' into 'main'

See merge request isc-projects/bind9!9603

19 months agoAdd libjson-c-dev before #4960 is addressed
Michal Nowak [Wed, 9 Oct 2024 10:53:50 +0000 (12:53 +0200)] 
Add libjson-c-dev before #4960 is addressed

Otherwise the "statistics-channels" option in doc/misc/options and
doc/man/named.conf.5in is marked as "not configured" (contrary to what
we have in release tarballs as they were build on a different image that
has libjson-c and libxml2 in it).

Caused by #4895 that made the option dependant on libjson-c or libxml2
presence in the build image.

19 months agoAlways use requirements.txt from main
Michal Nowak [Wed, 9 Oct 2024 10:26:28 +0000 (12:26 +0200)] 
Always use requirements.txt from main

Instances of the requirements.txt file may be outdated in other
branches.

19 months agoDrop BIND 9.16 support
Michal Nowak [Wed, 9 Oct 2024 09:29:58 +0000 (11:29 +0200)] 
Drop BIND 9.16 support

19 months agochg: ci: Increase shotgun pipeline timeout
Nicki Křížek [Mon, 14 Oct 2024 11:02:06 +0000 (11:02 +0000)] 
chg: ci: Increase shotgun pipeline timeout

When running shotgun tests on tagged releases, the increased number of
jobs may cause the shotgun pipeline to take longer than 50 minutes to
finish.

Merge branch 'nicki/increase-shotgun-pipeline-timeout' into 'main'

See merge request isc-projects/bind9!9599

19 months agoIncrease shotgun pipeline timeout
Nicki Křížek [Tue, 8 Oct 2024 14:22:19 +0000 (16:22 +0200)] 
Increase shotgun pipeline timeout

When running shotgun tests on tagged releases, the increased number of
jobs may cause the shotgun pipeline to take longer than 50 minutes to
finish.

19 months agochg: usr: Harden key management when key files have become unavailabe
Matthijs Mekking [Mon, 14 Oct 2024 07:15:41 +0000 (07:15 +0000)] 
chg: usr: Harden key management when key files have become unavailabe

Prior to doing key management, BIND 9 will check if the key files on disk match the expected keys. If key files for previously observed keys have become unavailable, this will prevent the internal key manager from running.

Merge branch '4763-do-not-roll-if-key-files-are-missing' into 'main'

See merge request isc-projects/bind9!9337

19 months agoAdd new behavior to the ARM
Matthijs Mekking [Fri, 11 Oct 2024 12:38:55 +0000 (14:38 +0200)] 
Add new behavior to the ARM

Add text to the ARM that describes what we do in case key files have
become unavailable.

19 months agoTest removing DNSKEYs from other providers
Matthijs Mekking [Tue, 20 Aug 2024 12:38:24 +0000 (14:38 +0200)] 
Test removing DNSKEYs from other providers

In a multi-signer setup, removing DNSKEY records from the zone should
not be treated as a key that previously exists in the keyring, thus
blocking the keymgr. Add a test case to make sure.

19 months agoSmall keymgr improvement
Matthijs Mekking [Mon, 19 Aug 2024 07:49:21 +0000 (09:49 +0200)] 
Small keymgr improvement

When a key is to be purged, don't run the key state machinery for it.

19 months agoAdd additional test case with purged key
Matthijs Mekking [Mon, 19 Aug 2024 07:46:56 +0000 (09:46 +0200)] 
Add additional test case with purged key

Test that if a key to be purged is in the keyring, it does not
prevent the keymgr from running. Normally a key that is in the keyring
should be available again on the next run, but that is not true for
a key that can be purged.

In addition, fix some wait_for_log calls, by adding the missing
'|| ret=1' parts.

19 months agoFix some system test cases
Matthijs Mekking [Wed, 14 Aug 2024 12:38:22 +0000 (14:38 +0200)] 
Fix some system test cases

Some test cases were working but for the wrong reasons. These started
to fail when I implemented the first approach for #4763, where the
existence of a DNSKEY together with an empty keyring is suspicious and
would prevent the keymgr from running.

These are:

1. kasp: The multisigner-model2.kasp zone has ZSKs from other providers
   in the zone, but not yet its own keys. Pregenerate signing keys and
   add them to the unsigned zone as well.

2. kasp: The dynamic-signed-inline-signing.kasp zone has a key generated
   and added in the raw version of the zone. But the key file is stored
   outside the key-directory for the given zone. Add '-K keys' to the
   dnssec-keygen command.

19 months agoVerify new key files before running keymgr
Matthijs Mekking [Thu, 15 Aug 2024 08:36:15 +0000 (10:36 +0200)] 
Verify new key files before running keymgr

Prior to running the keymgr, first make sure that existing keys
are present in the new keylist. If not, treat this as an operational
error where the keys are made offline (temporarily), possibly unwanted.

19 months agoAdd test for missing key files, don't roll
Matthijs Mekking [Wed, 3 Jul 2024 09:32:11 +0000 (11:32 +0200)] 
Add test for missing key files, don't roll

In this specific case the key files are temporary unavailable, for
example because of an operator error, or a mount failure). In such
cases, BIND should not try to roll over these keys.

19 months agofix: dig - always set the default port when doing a UDP query
Artem Boldariev [Thu, 10 Oct 2024 19:05:54 +0000 (19:05 +0000)] 
fix: dig - always set the default port when doing a UDP query

This commit ensures that the port is set before attempting a UDP
query. Before that a situation could appear when previous query have
completed over a different transport (that uses a dedicated port) and
then a UDP query will be attempted over the port of the previous
transport.

Closes: #4984.
Merge branch 'artem-debian-bug-1059582' into 'main'

See merge request isc-projects/bind9!9618

19 months agodig: always set the default port when doing a UDP query
Artem Boldariev [Thu, 10 Oct 2024 10:18:05 +0000 (13:18 +0300)] 
dig: always set the default port when doing a UDP query

This commit ensures that the port is set before attempting a UDP
query. Before that a situation could appear when previous query have
completed over a different transport (that uses a dedicated port) and
then a UDP query will be attempted over the port of the previous
transport.

19 months agochg: doc: Add release note for #4460
Matthijs Mekking [Thu, 10 Oct 2024 10:22:57 +0000 (10:22 +0000)] 
chg: doc: Add release note for #4460

This release note was missing due to a malformed Merge Request title.

The text is not copied verbatim, but changed to something more release
note-like.

Merge branch '4460-add-missing-release-note' into 'main'

See merge request isc-projects/bind9!9598

19 months agoAdd release note for #4460
Matthijs Mekking [Tue, 8 Oct 2024 12:42:37 +0000 (14:42 +0200)] 
Add release note for #4460

This release note was missing due to a malformed Merge Request title.

The text is not copied verbatim, but changed to something more release
note-like.

19 months agofix: dev: Revert "Improve performance when looking for the closest encloser"
Matthijs Mekking [Thu, 10 Oct 2024 09:27:29 +0000 (09:27 +0000)] 
fix: dev: Revert "Improve performance when looking for the closest encloser"

Revert "fix: chg: Improve performance when looking for the closest encloser when returning NSEC3 proofs"

This reverts merge request !9436

Closes #4950

Merge branch 'revert-78d48f7a' into 'main'

See merge request isc-projects/bind9!9611

19 months agoRevert "fix: chg: Improve performance when looking for the closest encloser when...
Matthijs Mekking [Thu, 10 Oct 2024 06:59:28 +0000 (06:59 +0000)] 
Revert "fix: chg: Improve performance when looking for the closest encloser when returning NSEC3 proofs"

This reverts merge request !9436

19 months agofix: dev: Fix error path bugs in the manager's "recursing-clients" list management
Arаm Sаrgsyаn [Wed, 9 Oct 2024 11:38:35 +0000 (11:38 +0000)] 
fix: dev: Fix error path bugs in the manager's "recursing-clients" list management

In two places, after linking the client to the manager's
"recursing-clients" list using the check_recursionquota()
function, the query.c module fails to unlink it on error
paths. Fix the bugs by unlinking the client from the list.

Merge branch 'aram/unlink-recursing-clients-on-error-paths' into 'main'

See merge request isc-projects/bind9!9586

19 months agoRefactor the way check_recursionquota() is used
Aram Sargsyan [Wed, 2 Oct 2024 16:39:13 +0000 (16:39 +0000)] 
Refactor the way check_recursionquota() is used

Rename check_recursionquota() to acquire_recursionquota(), and
implement a new function called release_recursionquota() to
reverse the action. It helps with decreasing code duplication.

19 months agoFix error path bugs in the "recursing-clients" list management
Aram Sargsyan [Wed, 2 Oct 2024 16:22:38 +0000 (16:22 +0000)] 
Fix error path bugs in the "recursing-clients" list management

In two places, after linking the client to the manager's
"recursing-clients" list using the check_recursionquota()
function, the query.c module fails to unlink it on error
paths. Fix the bugs by unlinking the client from the list.

Also make sure that unlinking happens before detaching the
client's handle, as it is the logically correct order, e.g.
in case if it's the last handle and ns__client_reset_cb()
can be called because of the detachment.

19 months agofix: dev: Fix a data race in dns_zone_getxfrintime()
Arаm Sаrgsyаn [Wed, 9 Oct 2024 10:31:09 +0000 (10:31 +0000)] 
fix: dev: Fix a data race in dns_zone_getxfrintime()

The dns_zone_getxfrintime() function fails to lock the zone before
accessing its 'xfrintime' structure member, which can cause a data
race between soa_query() and the statistics channel. Add the missing
locking/unlocking pair, like it's done in numerous other similar
functions.

Closes #4976

Merge branch '4976-zone-xfrintime-data-race-fix' into 'main'

See merge request isc-projects/bind9!9591

19 months agoFix a data race in dns_zone_getxfrintime()
Aram Sargsyan [Mon, 7 Oct 2024 12:26:59 +0000 (12:26 +0000)] 
Fix a data race in dns_zone_getxfrintime()

The dns_zone_getxfrintime() function fails to lock the zone before
accessing its 'xfrintime' structure member, which can cause a data
race between soa_query() and the statistics channel. Add the missing
locking/unlocking pair, like it's done in numerous other similar
functions.

19 months agofix: dev: Clean up 'nodetach' in ns_client
Arаm Sаrgsyаn [Wed, 9 Oct 2024 09:12:45 +0000 (09:12 +0000)] 
fix: dev: Clean up 'nodetach' in ns_client

The 'nodetach' member is a leftover from the times when non-zero
'stale-answer-client-timeout' values were supported, and currently
is always 'false'. Clean up the member and its usage.

Merge branch 'aram/cleanup-ns-client-nodetach' into 'main'

See merge request isc-projects/bind9!9592

19 months agoClean up 'nodetach' in ns_client
Aram Sargsyan [Mon, 7 Oct 2024 15:29:14 +0000 (15:29 +0000)] 
Clean up 'nodetach' in ns_client

The 'nodetach' member is a leftover from the times when non-zero
'stale-answer-client-timeout' values were supported, and currently
is always 'false'. Clean up the member and its usage.

19 months agochg: doc: Set up version for BIND 9.21.3
Michal Nowak [Tue, 8 Oct 2024 08:40:41 +0000 (08:40 +0000)] 
chg: doc: Set up version for BIND 9.21.3

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

See merge request isc-projects/bind9!9595

19 months agoUpdate BIND version to 9.21.3-dev
Michal Nowak [Tue, 8 Oct 2024 08:30:48 +0000 (10:30 +0200)] 
Update BIND version to 9.21.3-dev

19 months agoUpdate BIND version for release v9.21.2
Michal Nowak [Mon, 7 Oct 2024 14:07:08 +0000 (16:07 +0200)] 
Update BIND version for release

19 months agonew: doc: Prepare documentation for BIND 9.21.2
Michal Nowak [Mon, 7 Oct 2024 14:05:36 +0000 (14:05 +0000)] 
new: doc: Prepare documentation for BIND 9.21.2

Merge branch 'mnowak/prepare-documentation-for-bind-9.21.2' into 'v9.21.2-release'

See merge request isc-private/bind9!743

19 months agoTweak and reword release notes
Michal Nowak [Thu, 3 Oct 2024 16:27:30 +0000 (18:27 +0200)] 
Tweak and reword release notes

19 months agoPrepare release notes for BIND 9.21.2
Michal Nowak [Thu, 3 Oct 2024 12:16:36 +0000 (14:16 +0200)] 
Prepare release notes for BIND 9.21.2

19 months agoGenerate release notes
Michal Nowak [Thu, 3 Oct 2024 12:15:34 +0000 (14:15 +0200)] 
Generate release notes

19 months agoGenerate changelog
Michal Nowak [Thu, 3 Oct 2024 12:15:06 +0000 (14:15 +0200)] 
Generate changelog

19 months agofix: dev: Don't enable REUSEADDR on outgoing UDP sockets
Ondřej Surý [Wed, 2 Oct 2024 12:16:03 +0000 (12:16 +0000)] 
fix: dev: Don't enable REUSEADDR on outgoing UDP sockets

The outgoing UDP sockets enabled `SO_REUSEADDR` that allows sharing of the UDP sockets, but with one big caveat - the socket that was opened the last would get all traffic.  The dispatch code would ignore the invalid responses in the dns_dispatch, but this could lead to unexpected results.

Merge branch 'ondrej/fix-outgoing-UDP-port-selection' into 'main'

See merge request isc-projects/bind9!9569

19 months agoDon't enable SO_REUSEADDR on outgoing UDP sockets
Ondřej Surý [Mon, 30 Sep 2024 16:01:47 +0000 (18:01 +0200)] 
Don't enable SO_REUSEADDR on outgoing UDP sockets

Currently, the outgoing UDP sockets have enabled
SO_REUSEADDR (SO_REUSEPORT on BSDs) which allows multiple UDP sockets to
bind to the same address+port.  There's one caveat though - only a
single (the last one) socket is going to receive all the incoming
traffic.  This in turn could lead to incoming DNS message matching to
invalid dns_dispatch and getting dropped.

Disable setting the SO_REUSEADDR on the outgoing UDP sockets.  This
needs to be done explicitly because `uv_udp_open()` silently enables the
option on the socket.

19 months agofix: usr: Fix assertion failure when receiving DNS responses over TCP
Ondřej Surý [Wed, 2 Oct 2024 10:41:26 +0000 (10:41 +0000)] 
fix: usr: Fix assertion failure when receiving DNS responses over TCP

When matching the received Query ID in the TCP connection,
an invalid received Query ID can very rarely cause assertion
failure.

Closes #4952

Merge branch '4952-check-whether-QID-is-not-deleted' into 'main'

See merge request isc-projects/bind9!9580

19 months agoSkip TCP dispatch responses that are not ours
Ondřej Surý [Wed, 2 Oct 2024 06:37:48 +0000 (08:37 +0200)] 
Skip TCP dispatch responses that are not ours

When matching the TCP dispatch responses, we should skip the responses
that do not belong to our TCP connection.  This can happen with faulty
upstream server that sends invalid QID back to us.

19 months agofix: dev: Don't ignore the local port number in dns_dispatch_add() for TCP
Arаm Sаrgsyаn [Wed, 2 Oct 2024 09:51:40 +0000 (09:51 +0000)] 
fix: dev: Don't ignore the local port number in dns_dispatch_add() for TCP

The dns_dispatch_add() function registers the 'resp' entry in
'disp->mgr->qids' hash table with 'resp->port' being 0, but in
tcp_recv_success(), when looking up an entry in the hash table
after a successfully received data the port is used, so if the
local port was set (i.e. it was not 0) it fails to find the
entry and results in an unexpected error.

Set the 'resp->port' to the given local port value extracted from
'disp->local'.

Closes #4969

Merge branch '4969-dispatch-tcp-source-port-bug-fix' into 'main'

See merge request isc-projects/bind9!9576

19 months agoDon't ignore the local port number in dns_dispatch_add() for TCP
Aram Sargsyan [Tue, 1 Oct 2024 14:16:47 +0000 (14:16 +0000)] 
Don't ignore the local port number in dns_dispatch_add() for TCP

The dns_dispatch_add() function registers the 'resp' entry in
'disp->mgr->qids' hash table with 'resp->port' being 0, but in
tcp_recv_success(), when looking up an entry in the hash table
after a successfully received data the port is used, so if the
local port was set (i.e. it was not 0) it fails to find the
entry and results in an unexpected error.

Set the 'resp->port' to the given local port value extracted from
'disp->local'.

19 months agonew: usr: Support ISO timestamps with timezone information
Alessio Podda [Wed, 2 Oct 2024 08:16:17 +0000 (08:16 +0000)] 
new: usr: Support ISO timestamps with timezone information

The configuration option `print-time` can now be set to `iso8601-tzinfo` in order to use the ISO 8601 timestamp with timezone information when logging. This is used as a default for `named -g`.

Closes #4963

Merge branch '4963-provide-timezone-information-in-log-timestamps' into 'main'

See merge request isc-projects/bind9!9563

19 months agoSupport ISO timestamps with timezone information
Alessio Podda [Wed, 25 Sep 2024 14:46:16 +0000 (16:46 +0200)] 
Support ISO timestamps with timezone information

This commit adds support for timestamps in iso8601 format with timezone
when logging. This is exposed through the iso8601-tzinfo printtime
suboption.
It also makes the new logging format the default for -g output,
hopefully removing the need for custom timestamp parsing in scripts.

19 months agochg: test: Replace dns.query module with isctest.query
Michal Nowak [Tue, 1 Oct 2024 12:05:39 +0000 (12:05 +0000)] 
chg: test: Replace dns.query module with isctest.query

The `dns.query.udp` and `dns.query.tcp` methods are [prone to timeouts](https://gitlab.isc.org/isc-projects/bind9/-/jobs/4785053); their `isctest.query` equivalents should be used in system tests instead.

Merge branch 'mnowak/convert-dns-query-udp-and-tcp-to-isctest-query' into 'main'

See merge request isc-projects/bind9!9560

19 months agoReplace dns.query module with isctest.query
Michal Nowak [Fri, 27 Sep 2024 11:35:56 +0000 (13:35 +0200)] 
Replace dns.query module with isctest.query

19 months agoAdd isctest.check.notimp()
Michal Nowak [Fri, 27 Sep 2024 11:37:39 +0000 (13:37 +0200)] 
Add isctest.check.notimp()

19 months agoReport expected and last returned rcode on query timeout
Michal Nowak [Fri, 27 Sep 2024 11:38:00 +0000 (13:38 +0200)] 
Report expected and last returned rcode on query timeout

Sometimes it's useful to see what was the server returning that did not
match the expected rcode.

19 months agofix: dev: Null clausedefs for ancient options
Alessio Podda [Tue, 1 Oct 2024 10:33:56 +0000 (10:33 +0000)] 
fix: dev: Null clausedefs for ancient options

This commit nulls all type fields for the clausedef lists that are
declared ancient, and removes the corresponding cfg_type_t and parsing
functions when they are found to be unused after the change.

Among others, it removes some leftovers from #1913.

Closes #4962

Merge branch '4962-null-clausedef-types-for-ancient-options' into 'main'

See merge request isc-projects/bind9!9552

19 months agoNull clausedefs for ancient options
alessio [Wed, 25 Sep 2024 06:19:02 +0000 (08:19 +0200)] 
Null clausedefs for ancient options

This commit nulls all type fields for the clausedef lists that are
declared ancient, and removes the corresponding cfg_type_t and parsing
functions when they are found to be unused after the change.

19 months agofix: doc: Restore text about sig validity and SOA expire
Matthijs Mekking [Tue, 1 Oct 2024 06:32:48 +0000 (06:32 +0000)] 
fix: doc: Restore text about sig validity and SOA expire

When `sig-validity-interval` was obsoleted, the text that the signature validity interval should be multiples of the SOA expire interval was removed. Restore this text to the description of the `signatures-validity` option.

Closes #4951

Merge branch '4951-document-signatures-validity-soa-expire' into 'main'

See merge request isc-projects/bind9!9566

19 months agoUpdate example.com zone SOA expire value
Matthijs Mekking [Mon, 30 Sep 2024 09:49:07 +0000 (11:49 +0200)] 
Update example.com zone SOA expire value

The example.com zone file given in the "Configurations and Zone Files"
chapter has an SOA expire of 3 weeks, which is not a multiple of
the default signatures-validity value. Adjust the SOA expire so that
it is much lower than the signatures-validity default.

19 months agoRestore text about sig validity and SOA expire
Matthijs Mekking [Mon, 30 Sep 2024 09:39:57 +0000 (11:39 +0200)] 
Restore text about sig validity and SOA expire

When `sig-validity-interval` was obsoleted, the text that the signature
validity interval should be multiples of the SOA expire interval was
removed. Restore this text to the description of the
`signatures-validity` option.

19 months agofix: usr: Fix a bug in the static-stub implementation
Mark Andrews [Tue, 1 Oct 2024 01:26:56 +0000 (01:26 +0000)] 
fix: usr: Fix a bug in the static-stub implementation

Static-stub addresses and addresses from other sources were being
mixed together, resulting in static-stub queries going to addresses
not specified in the configuration, or alternatively, static-stub
addresses being used instead of the correct server addresses.

Closes #4850

Merge branch '4850-add-an-additional-class-of-names-to-adb' into 'main'

See merge request isc-projects/bind9!9314

19 months agoStore static-stub addresses seperately in the adb
Mark Andrews [Wed, 14 Aug 2024 13:46:44 +0000 (23:46 +1000)] 
Store static-stub addresses seperately in the adb

Static-stub address and addresses from other sources where being
mixed together resulting in static-stub queries going to addresses
not specified in the configuration or alternatively static-stub
addresses being used instead of the real addresses.

19 months agorem: dev: Remove unused function dns_zonemgr_resumexfrs()
Petr Špaček [Mon, 30 Sep 2024 12:42:22 +0000 (12:42 +0000)] 
rem: dev: Remove unused function dns_zonemgr_resumexfrs()

Merge branch 'pspacek/zone-xfr-cleanup' into 'main'

See merge request isc-projects/bind9!9565

19 months agoRemove unused function dns_zonemgr_resumexfrs()
Petr Špaček [Fri, 27 Sep 2024 14:44:21 +0000 (16:44 +0200)] 
Remove unused function dns_zonemgr_resumexfrs()

19 months agochg: dev: Use release memory ordering when incrementing reference counter
Ondřej Surý [Mon, 30 Sep 2024 12:22:05 +0000 (12:22 +0000)] 
chg: dev: Use release memory ordering when incrementing reference counter

As the relaxed memory ordering doesn't ensure any memory
synchronization, it is possible that the increment will succeed even
in the case when it should not - there is a race between
atomic_fetch_sub(..., acq_rel) and atomic_fetch_add(..., relaxed).
Only the result is consistent, but the previous value for both calls
could be same when both calls are executed at the same time.

Merge branch 'ondrej/use-release-memory-ordering-for-reference-counting' into 'main'

See merge request isc-projects/bind9!9460

19 months agoUse release memory ordering when incrementing reference counter
Ondřej Surý [Mon, 9 Sep 2024 14:03:53 +0000 (16:03 +0200)] 
Use release memory ordering when incrementing reference counter

As the relaxed memory ordering doesn't ensure any memory
synchronization, it is possible that the increment will succeed even
in the case when it should not - there is a race between
atomic_fetch_sub(..., acq_rel) and atomic_fetch_add(..., relaxed).
Only the result is consistent, but the previous value for both calls
could be same when both calls are executed at the same time.

19 months agofix: dev: Add a missing rcu_read_unlock() call on exit path
Arаm Sаrgsyаn [Fri, 27 Sep 2024 13:50:54 +0000 (13:50 +0000)] 
fix: dev: Add a missing rcu_read_unlock() call on exit path

An exit path in the dns_dispatch_add() function fails to get out of
the RCU critical section when returning early. Add the missing
rcu_read_unlock() call.

Merge branch 'aram/add-missing-rcu_read_unlock-in-dns_dispatch_add' into 'main'

See merge request isc-projects/bind9!9561

19 months agoAdd a missing rcu_read_unlock() call on exit path
Aram Sargsyan [Fri, 27 Sep 2024 12:48:22 +0000 (12:48 +0000)] 
Add a missing rcu_read_unlock() call on exit path

An exit path in the dns_dispatch_add() function fails to get out of
the RCU critical section when returning early. Add the missing
rcu_read_unlock() call.

19 months agodev: Add full Alessio's name to .mailmap to fix some of the older commits
Ondřej Surý [Thu, 26 Sep 2024 11:48:16 +0000 (11:48 +0000)] 
dev: Add full Alessio's name to .mailmap to fix some of the older commits

Merge branch 'ondrej/add-alessio-to-.mailmap' into 'main'

See merge request isc-projects/bind9!9557