]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
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

19 months agoAdd full Alessio's name to .mailmap to fix some of the older commits
Ondřej Surý [Thu, 26 Sep 2024 11:45:38 +0000 (13:45 +0200)] 
Add full Alessio's name to .mailmap to fix some of the older commits

19 months agochg: usr: Honour the Control Group memory contraints on Linux
Ondřej Surý [Thu, 26 Sep 2024 11:20:14 +0000 (11:20 +0000)] 
chg: usr: Honour the Control Group memory contraints on Linux

On Linux, the system administrator can use Control Group ``cgroup``
mechanism to limit the amount of available memory to the process.  This
limit will be honoured when calculating the percentage-based values.

Merge branch 'ondrej/use-uv_get_available_memory-doc' into 'main'

See merge request isc-projects/bind9!9556

19 months agoDocument that we now honour the cgroup memory limit
Ondřej Surý [Thu, 26 Sep 2024 10:49:52 +0000 (12:49 +0200)] 
Document that we now honour the cgroup memory limit

On Linux, the system administrator can use Control Group ``cgroup``
mechanism to limit the amount of available memory to the process.  This
limit will be honoured when calculating the percentage-based values.

19 months agonew: usr: Added WALLET type
Mark Andrews [Wed, 25 Sep 2024 12:03:45 +0000 (12:03 +0000)] 
new: usr: Added WALLET type

Add the new record type WALLET (262).  This provides a mapping from a domain name to a cryptographic currency wallet.  Multiple mappings can exist if multiple records exist.

Closes #4947

Merge branch '4947-add-wallet-type-to-named' into 'main'

See merge request isc-projects/bind9!9521

19 months agoAdd examples of WALLET records
Mark Andrews [Wed, 18 Sep 2024 22:45:50 +0000 (08:45 +1000)] 
Add examples of WALLET records

19 months agoAdd the new record type WALLET (262)
Mark Andrews [Wed, 18 Sep 2024 22:45:50 +0000 (08:45 +1000)] 
Add the new record type WALLET (262)

This provides a mapping from a domain name to a cryptographic
currency wallet and is a clone of TXT.

19 months agofix: usr: Fix the 'rndc dumpdb' command's error reporting
Arаm Sаrgsyаn [Wed, 25 Sep 2024 09:07:46 +0000 (09:07 +0000)] 
fix: usr: Fix the 'rndc dumpdb' command's error reporting

The 'rndc dumpdb' command wasn't reporting errors which
occurred when starting up the database dump process by named,
like, for example, a permission denied error for the
'dump-file' file. This has been fixed. Note, however, that
'rndc dumpdb' performs asynchronous writes, so errors can
also occur during the dumping process, which will not be
reported back to 'rndc', but which will still be logged by
named.

Closes #4944

Merge branch '4944-rndc-dumpdb-do-not-ignore-errors' into 'main'

See merge request isc-projects/bind9!9547

19 months agoTest 'rndc dumpdb' with an unwritable dump-file
Aram Sargsyan [Tue, 24 Sep 2024 09:49:04 +0000 (09:49 +0000)] 
Test 'rndc dumpdb' with an unwritable dump-file

Check that with a preexisting dump file without a write permission
no actual dump happens, and rndc returns an error result.

Also add a couple of missing entries in the cleaning script.

19 months agoDo not ignore named_server_dumpdb() result code
Aram Sargsyan [Tue, 24 Sep 2024 08:53:47 +0000 (08:53 +0000)] 
Do not ignore named_server_dumpdb() result code

The named_server_dumpdb() function, which is called when a 'rndc dumpdb'
command is issued, returns a 'isc_result_t' result code and it has been
always ignored since its introduction in
eb8713ed947fdf22a41dad673d561896dd6fe4a2, where it was still called
ns_server_dumpdb(). The orignal reasoning is not preserved, but it could
have been also a simple copy-paste mistake, as there are commands, which
return 'void' and require manually setting 'result = ISC_R_SUCCESS;', as
it was done here. Anyway, named will now return the actual result, and
'rndc' will report an error, when the 'dumpdb' command fails.

19 months agochg: doc: Track changes in separate files
Nicki Křížek [Tue, 24 Sep 2024 14:12:29 +0000 (14:12 +0000)] 
chg: doc: Track changes in separate files

Keep the changelog for each version in a separate source file to avoid
rebase conflicts when handling the -S version.

---

Related !9528

Closes #4946

Merge branch 'nicki/reorganize-changelog-docfiles-9.21' into 'main'

See merge request isc-projects/bind9!9549

19 months agoFix changelog entry for [GL #4759]
Nicki Křížek [Tue, 24 Sep 2024 13:20:21 +0000 (15:20 +0200)] 
Fix changelog entry for [GL #4759]

19 months agoGenerate changelog to stdout
Nicki Křížek [Tue, 24 Sep 2024 12:04:16 +0000 (14:04 +0200)] 
Generate changelog to stdout

Since the changes aren't tracked in the single changelog.rst file,
generate the changelog to stdout instead, so it can be easily redirected
to the proper file.

19 months agoTrack changes in separate files
Nicki Křížek [Tue, 24 Sep 2024 11:59:56 +0000 (13:59 +0200)] 
Track changes in separate files

Keep the changelog for each version in a separate source file to avoid
rebase conflicts when handling the -S version.

19 months agochg: dev: Use libuv functions to get memory available to BIND 9
Ondřej Surý [Tue, 24 Sep 2024 13:51:55 +0000 (13:51 +0000)] 
chg: dev: Use libuv functions to get memory available to BIND 9

This change uses uv_get_available_memory() if available with fallback
to uv_get_constrained_memory() with fallback to uv_get_total_memory().

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

See merge request isc-projects/bind9!9527

19 months agoUse libuv functions to get memory available to BIND 9
Ondřej Surý [Fri, 20 Sep 2024 07:10:20 +0000 (09:10 +0200)] 
Use libuv functions to get memory available to BIND 9

This change uses uv_get_total_memory() to get the memory available to
BIND 9 with possible modification by uv_get_constrained_memory() if the
libuv version is recent enough to honour constraints created by
f.e. cgroups.

19 months agochg: ci: Increase the load TCP/DoT shotgun perf tests
Nicki Křížek [Tue, 24 Sep 2024 11:15:12 +0000 (11:15 +0000)] 
chg: ci: Increase the load TCP/DoT shotgun perf tests

Due to the recent improvements to the TCP processing, much higher loads
can be handled by BIND9 without causing client timeouts. The updated
parameters give us useful data for both cold and hot cache testing.

Merge branch 'nicki/increase-tcp-dot-shotgun-load' into 'main'

See merge request isc-projects/bind9!9494

19 months agoIncrease the load TCP/DoT shotgun perf tests
Nicki Křížek [Thu, 12 Sep 2024 13:11:31 +0000 (15:11 +0200)] 
Increase the load TCP/DoT shotgun perf tests

Due to the recent improvements to the TCP processing, much higher loads
can be handled by BIND9 without causing client timeouts. The updated
parameters give us useful data for both cold and hot cache testing.

19 months agofix: test: Check read value in upforwd/ans4
Mark Andrews [Tue, 24 Sep 2024 07:26:27 +0000 (07:26 +0000)] 
fix: test: Check read value in upforwd/ans4

The ans4 server wasn't shutting down cleanly sometimes.  Check that read returns the
expected value for the message length or exit read loop.

Closes #4301

Merge branch '4301-check-read-value-in-ans4' into 'main'

See merge request isc-projects/bind9!9537

19 months agoCheck read value in upforwd/ans4
Mark Andrews [Mon, 23 Sep 2024 04:56:54 +0000 (14:56 +1000)] 
Check read value in upforwd/ans4

The ans4 server wasn't shutting down cleanly sometimes.  Check that
read returns the expected value for the message length or exit read
loop.

19 months agochg: test: Downgrade "timeout" and "attempts" arguments in shutdown
Michal Nowak [Mon, 23 Sep 2024 15:39:16 +0000 (15:39 +0000)] 
chg: test: Downgrade "timeout" and "attempts" arguments in shutdown

The shutdown system test sends queries when named is shutting down, not
in an attempt to get answers but to destabilize the server into a crash.
With isctest.query.udp() defaulting to try up to ten times with a
ten-second timeout to get a response we don't care about from a likely
terminated server, we make the test run much longer than needed because
of retries and long timeouts.

Also, see isc-projects/bind9#4943.

Merge branch 'mnowak/shutdown-downgrade-timeout-and-attempts-arguments' into 'main'

See merge request isc-projects/bind9!9507

19 months agoPrint correct udp/tcp function name in generic_query()
Michal Nowak [Mon, 16 Sep 2024 12:43:22 +0000 (14:43 +0200)] 
Print correct udp/tcp function name in generic_query()

19 months agoDowngrade "timeout" and "attempts" arguments in shutdown
Michal Nowak [Mon, 16 Sep 2024 12:55:06 +0000 (14:55 +0200)] 
Downgrade "timeout" and "attempts" arguments in shutdown

The shutdown system test sends queries when named is shutting down, not
in an attempt to get answers but to destabilize the server into a crash.
With isctest.query.udp() defaulting to try up to ten times with a
ten-second timeout to get a response we don't care about from a likely
terminated server, we make the test run much longer than needed because
of retries and long timeouts.

19 months agochg: ci: Exclude some RPZ files from long stress test artifacts
Michal Nowak [Mon, 23 Sep 2024 11:20:10 +0000 (11:20 +0000)] 
chg: ci: Exclude some RPZ files from long stress test artifacts

This fixes 6f868853049769cd4c327acf32a8c1a7320daa06, that excluded files
only from short stress tests.

Validation jobs:
- [x] short - [#4756989](https://gitlab.isc.org/isc-projects/bind9/-/jobs/4756989/artifacts/browse/output/ns4/) -
- [x] long - [#4757196](https://gitlab.isc.org/isc-projects/bind9/-/jobs/4757196/artifacts/browse/output/ns4/)

Merge branch 'mnowak/exclude-some-rpz-files-from-long-stress-tests-artifacts' into 'main'

See merge request isc-projects/bind9!9522

19 months agoExclude some RPZ files from long stress test artifacts
Michal Nowak [Thu, 19 Sep 2024 09:26:53 +0000 (11:26 +0200)] 
Exclude some RPZ files from long stress test artifacts

This fixes 6f868853049769cd4c327acf32a8c1a7320daa06, that excluded files
only from short stress tests.

19 months agochg: dev: Use uv_available_parallelism() if available
Ondřej Surý [Sat, 21 Sep 2024 11:31:26 +0000 (11:31 +0000)] 
chg: dev: Use uv_available_parallelism() if available

Instead of cooking up our own code for getting the number of available
CPUs for named to use, make use of uv_available_parallelism() from
libuv >= 1.44.0.

Merge branch 'ondrej/use-uv_available_parallelism-if-available' into 'main'

See merge request isc-projects/bind9!9524

19 months agoAdd support to read number of online CPUs on OpenBSD
Ondřej Surý [Fri, 20 Sep 2024 06:53:01 +0000 (08:53 +0200)] 
Add support to read number of online CPUs on OpenBSD

The OpenBSD doesn't have sysctlbyname(), but sysctl() can be used to
read the number of online/available CPUs by reading following MIB(s):
[CTL_HW, HW_NCPUONLINE] with fallback to [CTL_HW, HW_NCPU].

19 months agoCleanup the sysctlbyname and friends configure checks and ifdefs
Ondřej Surý [Fri, 20 Sep 2024 06:45:46 +0000 (08:45 +0200)] 
Cleanup the sysctlbyname and friends configure checks and ifdefs

Cleanup various checks and cleanups that are available on the all
platforms like sysctlbyname() and various related <sys/*.h> headers
that are either defined in POSIX or available on Linux and all BSDs.

19 months agoUse uv_available_parallelism() if available
Ondřej Surý [Thu, 19 Sep 2024 15:58:19 +0000 (17:58 +0200)] 
Use uv_available_parallelism() if available

Instead of cooking up our own code for getting the number of available
CPUs for named to use, make use of uv_available_parallelism() from
libuv >= 1.44.0.

19 months agofix: usr: Fix long-running incoming transfers
Ondřej Surý [Sat, 21 Sep 2024 08:52:38 +0000 (08:52 +0000)] 
fix: usr: Fix long-running incoming transfers

Incoming transfers that took longer than 30 seconds would stop reading from the TCP stream and the incoming transfer would be indefinitely stuck causing BIND 9 to hang during shutdown.

This has been fixed and the `max-transfer-time-in` and `max-transfer-idle-in` timeouts are now honoured.

Closes #4949

Merge branch '4949-fix-ignored-and-invalid-dispatch-timeout-in-dns_xfrin' into 'main'

See merge request isc-projects/bind9!9531

19 months agoDon't enable timeouts in dns_dispatch for incoming transfers
Ondřej Surý [Fri, 20 Sep 2024 13:13:09 +0000 (15:13 +0200)] 
Don't enable timeouts in dns_dispatch for incoming transfers

The dns_dispatch_add() call in the dns_xfrin unit had hardcoded 30
second limit.  This meant that any incoming transfer would be stopped in
it didn't finish within 30 seconds limit.  Additionally, dns_xfrin
callback was ignoring the return value from dns_dispatch_getnext() when
restarting the reading from the TCP stream; this could cause transfers
to get stuck waiting for a callback that would never come due to the
dns_dispatch having already been shut down.

Call the dns_dispatch_add() without a timeout and properly handle the
result code from the dns_dispatch_getnext().

19 months agoModify dns_dispatch API to accept zero timeout
Ondřej Surý [Fri, 20 Sep 2024 13:13:09 +0000 (15:13 +0200)] 
Modify dns_dispatch API to accept zero timeout

The dns_dispatch_add() has timeout parameter that could not be 0 (for
not timeout).  Modify the dns_dispatch implementation to accept a zero
timeout for cases where the timeouts are undesirable because they are
managed externally.

19 months agochg: ci: Update code formatting
Ondřej Surý [Sat, 21 Sep 2024 07:16:00 +0000 (07:16 +0000)] 
chg: ci: Update code formatting

Merge branch 'nicki/update-code-format' into 'main'

See merge request isc-projects/bind9!9533

19 months agoIgnore clang-format reformatting commit
Nicki Křížek [Fri, 20 Sep 2024 14:52:21 +0000 (16:52 +0200)] 
Ignore clang-format reformatting commit

19 months agoFix arguments-renamed pylint issue in iscconf.py
Nicki Křížek [Fri, 20 Sep 2024 14:09:33 +0000 (16:09 +0200)] 
Fix arguments-renamed pylint issue in iscconf.py

The argument name was different in the base class.

19 months agoUpdate code formatting
Nicki Křížek [Fri, 20 Sep 2024 14:06:55 +0000 (16:06 +0200)] 
Update code formatting

clang 19 was updated in the base image.

19 months agochg: dev: Restore the number of threadpool threads back to original value
Nicki Křížek [Fri, 20 Sep 2024 14:47:24 +0000 (14:47 +0000)] 
chg: dev: Restore the number of threadpool threads back to original value

The issue of long-running operations potentially blocking query resolution has been fixed. Revert this temporary workaround and restore the number of threadpool threads.

Related #4898

Merge branch '4898-remove-workaround-and-note' into 'main'

See merge request isc-projects/bind9!9530

19 months agoRemove fixed known issue [GL #4898]
Nicki Křížek [Fri, 20 Sep 2024 12:31:57 +0000 (14:31 +0200)] 
Remove fixed known issue [GL #4898]

19 months agoRevert "Double the number of threadpool threads"
Nicki Křížek [Fri, 20 Sep 2024 12:31:25 +0000 (14:31 +0200)] 
Revert "Double the number of threadpool threads"

This reverts commit 6857df20a40f4e05f465a7a3f5d24eeedce8fc6c.

19 months agochg: doc: Update sphinx to 7.4.7
Nicki Křížek [Fri, 20 Sep 2024 12:02:32 +0000 (12:02 +0000)] 
chg: doc: Update sphinx to 7.4.7

Merge branch 'nicki/update-sphinx' into 'main'

See merge request isc-projects/bind9!9529

19 months agoUpdate sphinx to 7.4.7
Nicki Křížek [Fri, 20 Sep 2024 12:01:03 +0000 (14:01 +0200)] 
Update sphinx to 7.4.7

19 months agonew: usr: Log query response status to the query log
Mark Andrews [Thu, 19 Sep 2024 23:09:07 +0000 (23:09 +0000)] 
new: usr: Log query response status to the query log

Log a query response summary using the new category `responses`.  Logging can be controlled by the option `responselog` and `rndc responselog`.

Closes #459

Merge branch '459-log-query-response-status' into 'main'

See merge request isc-projects/bind9!9449

19 months agoDocument 'responselog' in the ARM
Mark Andrews [Thu, 6 Jun 2024 01:53:55 +0000 (11:53 +1000)] 
Document 'responselog' in the ARM

19 months agoCheck responselog behaviour
Mark Andrews [Wed, 19 Jun 2019 07:40:21 +0000 (17:40 +1000)] 
Check responselog behaviour

Extends the resolver system test to to check whether responses are
logged to the query log in addition to the queries.

19 months agoMove common flags logging to shared functions
Petr Menšík [Wed, 6 Oct 2021 11:53:33 +0000 (13:53 +0200)] 
Move common flags logging to shared functions

Query and response log shares the same flags. Move flags logging out of
log_query to share it with log_response. Use buffer instead of snprintf
to fill flags a bit faster.

Signed-off-by: Petr Menšík <pemensik@redhat.com>
19 months agoMake responselog flags similar to querylog
Petr Menšík [Tue, 13 Jul 2021 18:12:11 +0000 (20:12 +0200)] 
Make responselog flags similar to querylog

Remove answer flag from log, log instead count of records for each
message section. Include EDNS version and few flags of response. Add
also status of result.

Still does not include body of responses rrset.

19 months agoReduce code duplication
Evan Hunt [Thu, 15 Jul 2021 01:54:01 +0000 (18:54 -0700)] 
Reduce code duplication

combined named_server_togglequerylog() and
named_server_toggleresponselog() into named_server_setortoggle().

19 months agoLog the rcode returned to for a query
Mark Andrews [Wed, 19 Jun 2019 06:20:24 +0000 (16:20 +1000)] 
Log the rcode returned to for a query

Log to the querylog the rcode of a previous query using
the identifier 'response:' to diffenciate queries from
responses.

19 months agochg: minor cleanup in qpcache
Evan Hunt [Thu, 19 Sep 2024 21:42:33 +0000 (21:42 +0000)] 
chg: minor cleanup in qpcache

when the QP cache was adapted from the RBTDB, some variable names weren't changed, and still incorrectly reference the RBT.

Merge branch 'each-qpcache-nits' into 'main'

See merge request isc-projects/bind9!9515

19 months agorename 'rbtiterator' and similar names in qpcache
Evan Hunt [Sat, 14 Sep 2024 02:26:54 +0000 (19:26 -0700)] 
rename 'rbtiterator' and similar names in qpcache

when the QP cache was adapted from the RBT database, some names
weren't changed. this could be confusing, so let's change them now.
also, we no longer need to include rbt.h.

20 months agoMerge tag 'v9.21.1'
Nicki Křížek [Wed, 18 Sep 2024 16:02:41 +0000 (18:02 +0200)] 
Merge tag 'v9.21.1'

20 months agorem: usr: Remove DNSRPS implementation from the open-source version
Ondřej Surý [Wed, 18 Sep 2024 15:39:40 +0000 (15:39 +0000)] 
rem: usr: Remove DNSRPS implementation from the open-source version

DNSRPS was the API for a commercial implementation of Response-Policy
Zones that was supposedly better.  However, it was never open-sourced
and has only ever been available from a single vendor.  This goes against
the principle that the open-source edition of BIND 9 should contain only
features that are generally available and universal.

This commit removes the DNSRPS implementation from BIND 9.  It may be
reinstated in the subscription edition if there's enough interest from
customers, but it would have to be rewritten as a plugin (hook) instead
of hard-wiring it again in so many places.

Merge branch 'ondrej/remove-DNSRPS-from-open-source-edition' into 'main'

See merge request isc-projects/bind9!9358

20 months agoRemove DNSRPS implementation
Ondřej Surý [Mon, 19 Aug 2024 15:19:21 +0000 (17:19 +0200)] 
Remove DNSRPS implementation

DNSRPS was the API for a commercial implementation of Response-Policy
Zones that was supposedly better.  However, it was never open-sourced
and has only ever been available from a single vendor.  This goes against
the principle that the open-source edition of BIND 9 should contain only
features that are generally available and universal.

This commit removes the DNSRPS implementation from BIND 9.  It may be
reinstated in the subscription edition if there's enough interest from
customers, but it would have to be rewritten as a plugin (hook) instead
of hard-wiring it again in so many places.

20 months agofix: dev: Clean up DNSRPS
Ondřej Surý [Wed, 18 Sep 2024 15:38:11 +0000 (15:38 +0000)] 
fix: dev: Clean up DNSRPS

Addressed several build and test errors when DNSRPS is enabled.

Merge branch 'each-dnsrps-cleanup' into 'main'

See merge request isc-projects/bind9!9374

20 months agofix DNSRPS errors
Evan Hunt [Tue, 20 Aug 2024 20:09:20 +0000 (13:09 -0700)] 
fix DNSRPS errors

silence some reported snprintf() overrun warnings that prevented
DNSRPS from building on some platforms.

20 months agouse uv_dlopen() instead of dlopen() when linking DNSRPZ
Evan Hunt [Thu, 22 Aug 2024 23:01:50 +0000 (16:01 -0700)] 
use uv_dlopen() instead of dlopen() when linking DNSRPZ

take advantage of libuv's shared library handling capability
when linking to a DNSRPS library.  (see b396f555861 and 37b9511ce1d
for prior related work.)

20 months agoRemove old cruft from dnsrps code
Ondřej Surý [Mon, 19 Aug 2024 13:41:43 +0000 (15:41 +0200)] 
Remove old cruft from dnsrps code

There was some old cruft for ancient compilers checking for attributes
that we regularly use, etc.  Just remove the cruft.

20 months agochg: usr: Set logging category for notify/xfer-in related messages
Arаm Sаrgsyаn [Tue, 17 Sep 2024 15:52:20 +0000 (15:52 +0000)] 
chg: usr: Set logging category for notify/xfer-in related messages

Some 'notify' and 'xfer-in' related log messages were logged at the
'general' category instead of their own category. This has been fixed.

Closes #2730

Merge branch '2730-logging-category-for-notify-and-xfer-related-messages' into 'main'

See merge request isc-projects/bind9!9451

20 months agoSet logging category for notify/xfer related messages
Aram Sargsyan [Thu, 22 Aug 2024 07:52:20 +0000 (07:52 +0000)] 
Set logging category for notify/xfer related messages

Some notify/xfer related log messages are logged at the general
category. Set a more suitable caterogry for those messages.

20 months agofix: usr: Limit the outgoing UDP send queue size
Ondřej Surý [Tue, 17 Sep 2024 14:02:16 +0000 (14:02 +0000)] 
fix: usr: Limit the outgoing UDP send queue size

If the operating system UDP queue gets full and the outgoing UDP sending
starts to be delayed, BIND 9 could exhibit memory spikes as it tries to
enqueue all the outgoing UDP messages.  Try a bit harder to deliver the
outgoing UDP messages synchronously and if that fails, drop the outgoing
DNS message that would get queued up and then timeout on the client side.

Closes #4930

Merge branch '4930-limit-the-UDP-send-queue' into 'main'

See merge request isc-projects/bind9!9506

20 months agoLimit the outgoing UDP send queue size
Ondřej Surý [Mon, 16 Sep 2024 07:10:36 +0000 (09:10 +0200)] 
Limit the outgoing UDP send queue size

If the operating system UDP queue gets full and the outgoing UDP sending
starts to be delayed, BIND 9 could exhibit memory spikes as it tries to
enqueue all the outgoing UDP messages.  As those are not going to be
delivered anyway (as we argued when we stopped enlarging the operating
system send and receive buffers), try to send the UDP messages directly
using `uv_udp_try_send()` and if that fails, drop the outgoing UDP
message.

20 months agodev: Ignore commit that reformatted sh script in git blame
Ondřej Surý [Tue, 17 Sep 2024 11:44:49 +0000 (11:44 +0000)] 
dev: Ignore commit that reformatted sh script in git blame

Merge branch 'ondrej/ignore-shfmt-git-blame' into 'main'

See merge request isc-projects/bind9!9510

20 months agoIgnore commit that reformatted sh script in git blame
Ondřej Surý [Tue, 17 Sep 2024 11:42:53 +0000 (13:42 +0200)] 
Ignore commit that reformatted sh script in git blame

20 months agofix: usr: Do not set SO_INCOMING_CPU
Alessio Podda [Mon, 16 Sep 2024 12:56:25 +0000 (12:56 +0000)] 
fix: usr: Do not set SO_INCOMING_CPU

We currently set SO_INCOMING_CPU incorrectly, and testing by Ondrej
shows that fixing the issue by setting affinities is worse than letting
the kernel schedule threads without constraints. So we should not set
SO_INCOMING_CPU anymore.

Closes #4936

Merge branch '4936-remove-so-incoming-cpu' into 'main'

See merge request isc-projects/bind9!9497

20 months agoDo not set SO_INCOMING_CPU
alessio [Thu, 12 Sep 2024 14:48:00 +0000 (16:48 +0200)] 
Do not set SO_INCOMING_CPU

We currently set SO_INCOMING_CPU incorrectly, and testing by Ondrej
shows that fixing the issue and setting affinities is worse than letting
the kernel schedule threads without constraints. So we should not set
SO_INCOMING_CPU anymore.

20 months agonew: usr: Implement the ForwardOnlyFail statistics channel counter
Arаm Sаrgsyаn [Mon, 16 Sep 2024 12:17:42 +0000 (12:17 +0000)] 
new: usr: Implement the ForwardOnlyFail statistics channel counter

The new ForwardOnlyFail statistics channel counter indicates the
number of queries failed due to bad forwarders for 'forward only'
zones.

Related to #1793

Merge branch 'aram/add-new-stats-channel-counter-forwardonlyfail' into 'main'

See merge request isc-projects/bind9!9498

20 months agoUpdate the statistics channel check in the forward system test
Aram Sargsyan [Thu, 12 Sep 2024 12:39:14 +0000 (12:39 +0000)] 
Update the statistics channel check in the forward system test

Check that the ForwardOnlyFail increases as expected.

20 months agoDocument the ForwardOnlyFail statistics channel counter
Aram Sargsyan [Thu, 12 Sep 2024 12:38:38 +0000 (12:38 +0000)] 
Document the ForwardOnlyFail statistics channel counter

Update ARM with the information about the new ForwardOnlyFail
counter.

20 months agoImplement the ForwardOnlyFail statistics channel counter
Aram Sargsyan [Thu, 12 Sep 2024 12:34:40 +0000 (12:34 +0000)] 
Implement the ForwardOnlyFail statistics channel counter

The new ForwardOnlyFail statistics channel counter indicates the
number of queries failed due to bad forwarders for 'forward only'
zones.

20 months agofix: usr: Fix a statistics channel counter bug when 'forward only' zones are used
Arаm Sаrgsyаn [Mon, 16 Sep 2024 09:30:56 +0000 (09:30 +0000)] 
fix: usr: Fix a statistics channel counter bug when 'forward only' zones are used

When resolving a zone with a 'forward only' policy, and
finding out that all the forwarders are marked as "bad",
the 'ServerQuota' counter of the statistics channel was
incorrectly increased. This has been fixed.

Closes #1793

Merge branch '1793-serverquota-counter-bug-with-forward-only' into 'main'

See merge request isc-projects/bind9!9493

20 months agoAdd a statistics channel check in the forward system test
Aram Sargsyan [Thu, 12 Sep 2024 12:17:28 +0000 (12:17 +0000)] 
Add a statistics channel check in the forward system test

Check that the fix in the previous commit works and that the
'ServerQuota' counter in the statistics channel is still unset
after a SERVFAIL result in a 'forward only' zone.

20 months agoFix a 'serverquota' counter calculation bug
Aram Sargsyan [Thu, 12 Sep 2024 11:50:28 +0000 (11:50 +0000)] 
Fix a 'serverquota' counter calculation bug

The 'all_spilled' local variable in resolver.c:fctx_getaddresses()
is 'true' by default, and only becomes false when there is at least
one successfully found NS address. However, when a 'forward only;'
configuration is used, the code jumps over the part where it looks
for NS addresses and doesn't reset the 'all_spilled' to false, which
results in incorretly increased 'serverquota' statistics variable,
and also in invalid return error code from the function. The result
code error didn't make any differences, because all codes other than
'ISC_R_SUCCESS' or 'DNS_R_WAIT' were treated in the same way, and
the result code was never logged anywhere.

Set the default value of 'all_spilled' to 'false', and only make it
'true' before actually starting to look up NS addresses.

20 months agochg: dev: Remove statslock from dnssec-signzone
Mark Andrews [Mon, 16 Sep 2024 02:49:11 +0000 (02:49 +0000)] 
chg: dev: Remove statslock from dnssec-signzone

Silence Coverity CID 468757 and 468767 (DATA RACE read not locked) by converting dnssec-signzone to use atomics for statistics counters rather than using a lock.

Closes #4939

Merge branch '4939-remove-stats-lock-from-dnssec-signzone' into 'main'

See merge request isc-projects/bind9!9496

20 months agoRemove 'statslock' from dnssec-signzone
Mark Andrews [Fri, 13 Sep 2024 03:30:34 +0000 (13:30 +1000)] 
Remove 'statslock' from dnssec-signzone

Silence Coverity CID 468757 and 468767 (DATA RACE read not locked)
by converting dnssec-signzone to use atomics for statistics counters
rather than using a lock.  This should be marginally faster than
using the lock as well when statistics are requested.

20 months agofix: usr: Separate DNSSEC validation from the long-running tasks
Ondřej Surý [Thu, 12 Sep 2024 14:35:08 +0000 (14:35 +0000)] 
fix: usr: Separate DNSSEC validation from the long-running tasks

As part of the KeyTrap \[CVE-2023-50387\] mitigation, the DNSSEC CPU-intensive operations were offloaded to a separate threadpool that we use to run other tasks that could affect the networking latency.

If that threadpool is running some long-running tasks like RPZ, catalog zone processing, or zone file operations, it would delay DNSSEC validations to a point where the resolving signed DNS records would fail.

Split the CPU-intensive and long-running tasks into separate threadpools in a way that the long-running tasks don't block the CPU-intensive operations.

Closes #4898

Merge branch '4898-move-offloaded-DNSSEC-to-own-threads' into 'main'

See merge request isc-projects/bind9!9473

20 months agoMove offloaded DNSSEC operations to different helper threads
Ondřej Surý [Mon, 9 Sep 2024 12:39:14 +0000 (14:39 +0200)] 
Move offloaded DNSSEC operations to different helper threads

Currently, the isc_work API is overloaded.  It runs both the
CPU-intensive operations like DNSSEC validations and long-term tasks
like RPZ processing, CATZ processing, zone file loading/dumping and few
others.

Under specific circumstances, when many large zones are being loaded, or
RPZ zones processed, this stops the CPU-intensive tasks and the DNSSEC
validation is practically stopped until the long-running tasks are
finished.

As this is undesireable, this commit moves the CPU-intensive operations
from the isc_work API to the isc_helper API that only runs fast memory
cleanups now.

20 months agoAdd isc_helper API that adds 1:1 thread for each loop
Ondřej Surý [Tue, 10 Sep 2024 13:02:53 +0000 (15:02 +0200)] 
Add isc_helper API that adds 1:1 thread for each loop

Add an extra thread that can be used to offload operations that would
affect latency, but are not long-running tasks; those are handled by
isc_work API.

Each isc_loop now has matching isc_helper thread that also built on top
of uv_loop.  In fact, it matches most of the isc_loop functionality, but
only the `isc_helper_run()` asynchronous call is exposed.

20 months agochg: test: Replace dns.resolver module in system tests
Michal Nowak [Thu, 12 Sep 2024 09:57:22 +0000 (09:57 +0000)] 
chg: test: Replace dns.resolver module in system tests

Closes #4634

Merge branch '4634-drop-dns.resolver-module-from-system-tests' into 'main'

See merge request isc-projects/bind9!9150

20 months agoExtract dns.rcode compatibility code to isctest.compat
Michal Nowak [Tue, 27 Aug 2024 18:14:00 +0000 (20:14 +0200)] 
Extract dns.rcode compatibility code to isctest.compat

20 months agoTurn off deadline for wildcard tests
Michal Nowak [Wed, 7 Aug 2024 18:53:00 +0000 (20:53 +0200)] 
Turn off deadline for wildcard tests

Tests that query BIND need much longer deadline to account for retries,
the default 200ms won't work.

20 months agoExtract "custom" named instances support to isctest.run module
Michal Nowak [Mon, 22 Jul 2024 14:20:02 +0000 (16:20 +0200)] 
Extract "custom" named instances support to isctest.run module

20 months agoRework query functions to retry by default
Michal Nowak [Tue, 16 Jul 2024 18:06:06 +0000 (20:06 +0200)] 
Rework query functions to retry by default