Commit Graph
38920 Commits
Author SHA1 Message Date
Ondřej Surý 25962dd188 Merge branch '4001-4002-retry-over-TCP-when-notify-sending-fails' into 'main'
Handle the failure to send notify more gracefully and with log

Closes #4001 and #4002

See merge request isc-projects/bind9!7805
2023-04-20 08:41:02 +00:00
Ondřej Surý f4fcb63152 Add CHANGES and release note for [GL #4001] [GL #4002] 2023-04-20 10:09:53 +02:00
Ondřej Surý 0d48ac5a93 Handle the failure to send notify more gracefully and with log
When dns_request_create() failed in notify_send_toaddr(), sending the
notify would silently fail.  When notify_done() failed, the error would
be logged on the DEBUG(2) level.

This commit remedies the situation by:

 * Promoting several messages related to notifies to INFO level and add
   a "success" log message at the INFO level

 * Adding a TCP fallback - when sending the notify over UDP fails, named
   will retry sending notify over TCP and log the information on the
   NOTICE level

 * When sending the notify over TCP fails, it will be logged on the
   WARNING level

Closes: #4001, #4002
2023-04-20 10:09:53 +02:00
Tony Finch 6892e463bf Merge branch '3998-check-countlabels' into 'main'
Check dns_name_countlabels() wrt DNS_NAME_MAXLABELS

Closes #3998

See merge request isc-projects/bind9!7822
2023-04-18 12:58:09 +00:00
Tony Finch 3dcfad81d8 Check dns_name_countlabels() wrt DNS_NAME_MAXLABELS
This test case was omitted from [GL !7803]
2023-04-18 13:32:09 +01:00
Tony Finch 89eeca7981 Merge branch 'fanf-inane' into 'main'
Fix several typoes in name_test

See merge request isc-projects/bind9!7800
2023-04-18 12:22:55 +00:00
Tony Finch 80a153e159 Fix several typos in name_test
`nane` -> `name`
2023-04-18 12:56:29 +01:00
Arаm Sаrgsyаn 2928ab4e5f Merge branch 'aram/xfer-test-bugfix' into 'main'
Fix variable name error in the xfer system test

See merge request isc-projects/bind9!7845
2023-04-18 09:38:12 +00:00
Aram Sargsyan 613a9fc659 Fix variable name error in the xfer system test
There is no 'ret' in this test, and it is obvious that 'ret=1'
should be 'tmp=1' for the check to work correctly, if the string
is not found in the log file.
2023-04-18 09:37:39 +00:00
Mark Andrews b23a3c7729 Merge branch '3996-in-fatal-only-pause-when-running' into 'main'
In fatal only pause loops when they are running.

Closes #3996

See merge request isc-projects/bind9!7825
2023-04-18 01:11:49 +00:00
Mark Andrews be68dd62ea isc_loopmgr_pause was called inappropriately
isc_loopmgr_pause can't be called before isc_loopmgr_run is
called as the thread ids are not yet valid.  If there is a
fatal error before isc_loopmgr_run is run then don't call
isc_loopmgr_pause.
2023-04-18 00:28:36 +00:00
Matthijs Mekking 453aaac2f0 Merge branch '3769-migrate-zsk-ksk-split-tocsk' into 'main'
kasp: Add test case for migrating KSK/ZSK to CSK

See merge request isc-projects/bind9!7306
2023-04-17 09:39:59 +00:00
Matthijs Mekking e752656a38 Add key state init debugging
When debugging an issue it can be useful to see what BIND initially
set the key states to.
2023-04-17 10:56:08 +02:00
Matthijs Mekking c42ec8a56e kasp: Add test case for migrating KSK/ZSK to CSK
Add a test case to cover #3679 where a user migrates from a KSK/ZSK
split using auto-dnssec maintain, to the default dnssec-policy (CSK).

The test actually does not use the default dnssec-policy, but it does
use one that has the same keys clause. For testing convenience, we use
the same propagation time values as other test cases that migrate to
dnssec-policy with mismatching existing key set.
2023-04-17 10:56:08 +02:00
Ondřej Surý 02edb42a0a Merge branch '4015-fix-forward_cancel-from-the-wrong-loop' into 'main'
Run the forward_cancel on the appropriate zone->loop

Closes #4015

See merge request isc-projects/bind9!7835
2023-04-14 15:13:03 +00:00
Ondřej Surý 2423907b87 Add CHANGES note for [GL #4015] 2023-04-14 16:31:48 +02:00
Ondřej Surý 3df3b5efbd Run the forward_cancel on the appropriate zone->loop
If the zone forwards are canceled from dns_zonemgr_shutdown(), the
forward_cancel() would get called from the main loop, which is wrong.
It needs to be called from the matching zone->loop.

Run the dns_request_cancel() via isc_async_run() on the loop associated
with the zone instead of calling the dns_request_cancel() directly from
the main loop.
2023-04-14 16:31:33 +02:00
Ondřej Surý 36a3c87c33 Merge branch 'ondrej/remove-unused-netmgr-worker-sendbuf' into 'main'
Remove unused netmgr->worker->sendbuf

See merge request isc-projects/bind9!7841
2023-04-14 14:20:52 +00:00
Ondřej Surý f677cf6b73 Remove unused netmgr->worker->sendbuf
By inspecting the code, it was discovered that .sendbuf member of the
isc__nm_networker_t was unused and just consuming ~64k per worker.
Remove the member and the association allocation/deallocation.
2023-04-14 16:20:14 +02:00
Arаm Sаrgsyаn 9bd88df624 Merge branch '4000-openssl-attr-malloc-vs-cmocka-define-malloc' into 'main'
unit tests: include an OpenSSL header before including cmocka.h

Closes #4000

See merge request isc-projects/bind9!7820
2023-04-14 12:12:13 +00:00
Aram Sargsyan 786b0689c6 Add a CHANGES note for [GL #4000] 2023-04-14 12:11:52 +00:00
Aram Sargsyan 87db9ea84c unit tests: include an OpenSSL header before including cmocka.h
OpenSSL 3.1.0 uses __attribute__(malloc), conflicting with a redefined
malloc in cmocka.h.

As a workaround, include an OpenSSL header file before including
cmocka.h in the unit tests where OpenSSL is used.
2023-04-14 12:11:52 +00:00
Petr Špaček 9e3f7f4d53 Merge branch 'pspacek/set-up-version-and-release-notes-for-bind-9.19.13' into 'main'
Set up version and release notes for BIND 9.19.13

See merge request isc-projects/bind9!7839
2023-04-14 09:03:19 +00:00
Petr Špaček 923eb6667f Update BIND version to 9.19.13-dev 2023-04-14 10:51:44 +02:00
Petr Špaček 0fb1e00469 Set up release notes for BIND 9.19.13 2023-04-14 10:51:23 +02:00
Arаm Sаrgsyаn 546312f06c Merge branch 'aram/dns_xfrin_create-use-after-free' into 'main'
Fix a use-after-free bug in dns_xfrin_create()

See merge request isc-projects/bind9!7832
2023-04-14 07:40:01 +00:00
Aram Sargsyan bf8e93aee5 Add a CHANGES note for [GL !7832] 2023-04-14 07:39:38 +00:00
Aram Sargsyan d8a207bd00 Fix a use-after-free bug in dns_xfrin_create()
'xfr' is used after detaching the only reference, which would
have destroyed the object.

Call dns_xfrin_detach() only after the final use of 'xfr'.
2023-04-14 07:39:38 +00:00
Mark Andrews 172c678f2b Merge branch '3980-add-timeouts-to-unit-tests' into 'main'
Draft: Resolve "Add timeouts to unit tests."

Closes #3980

See merge request isc-projects/bind9!7837
2023-04-14 06:34:36 +00:00
Mark Andrews 21a3d4f762 Use SIGABRT rather than SIGKILL for long running unit test
SIGABRT will produce a core dump which will allow for forensic
analysis of the unit test
2023-04-14 15:40:02 +10:00
Ondřej Surý b6c9ac75ad Merge branch '3980-revert-unit-test-forking' into 'main'
Revert "Kill unit tests that run more than 1200 seconds"

Closes #3980

See merge request isc-projects/bind9!7833
2023-04-14 04:19:40 +00:00
Ondřej Surý c60ce13127 Revert "Kill unit tests that run more than 1200 seconds"
This reverts commit 3d5c7cd46c which
added wrapper around all the unit tests that would run the unit test in
the forked process.

This makes any debugging of the unit tests too hard.  Futures attempts
to fix #3980 should add a custom automake test harness (log driver) that
would kill the unit test after configured timeout.
2023-04-14 06:14:19 +02:00
Mark Andrews 22fb1b115a Merge branch '4003-dump_histo-defined-but-not-used-on-fips-in-bin-named-statschannel-c' into 'main'
Resolve "'dump_histo' defined but not used on FIPS in bin/named/statschannel.c"

Closes #4003

See merge request isc-projects/bind9!7826
2023-04-12 23:49:55 +00:00
Mark Andrews 82d2434ff8 dump_histo is only used with extended stats
Wrap dump_histo with #if defined(EXTENDED_STATS)/#endif.  Reproduce
build failure with "configure --without-libxml2 --without-json-c"
2023-04-13 08:53:27 +10:00
Ondřej Surý 8117c11d09 Merge branch '3985-make-TCP-accept-a-tad-bit-faster' into 'main'
Fix the TCP accept quota code

Closes #3985

See merge request isc-projects/bind9!7823
2023-04-12 12:12:33 +00:00
Ondřej Surý b88ed40c96 Add CHANGES note for [GL #3985] 2023-04-12 14:10:37 +02:00
Ondřej Surý 1715cad685 Refactor the isc_quota code and fix the quota in TCP accept code
In e185412872, the TCP accept quota code
became broken in a subtle way - the quota would get initialized on the
first accept for the server socket and then deleted from the server
socket, so it would never get applied again.

Properly fixing this required a bigger refactoring of the isc_quota API
code to make it much simpler.  The new code decouples the ownership of
the quota and acquiring/releasing the quota limit.

After (during) the refactoring it became more clear that we need to use
the callback from the child side of the accepted connection, and not the
server side.
2023-04-12 14:10:37 +02:00
Ondřej Surý 1768522045 Convert tls_send() callback to use isc_job_run()
The tls_send() was already using uvreq; convert this to use more direct
isc_job_run() - the on-loop no-allocation method.
2023-04-12 14:10:37 +02:00
Ondřej Surý 1302345c93 Convert isc__nm_http_send() from isc_async_run() to isc_job_run()
The isc__nm_http_send() was already using uvreq; convert this to use
more direct isc_job_run() - the on-loop no-allocation method.
2023-04-12 14:10:37 +02:00
Ondřej Surý 3adba8ce23 Use isc_job_run() for reading from StreamDNS socket
Change the reading in the StreamDNS code to use isc_job_run() instead of
using isc_async_run() for less allocations and more streamlined
execution.
2023-04-12 14:10:37 +02:00
Ondřej Surý 74cbf523b3 Run closehandle_cb on run queue instead of async queue
Instead of using isc_async_run() when closing StreamDNS handle, add
isc_job_t member to the isc_nmhandle_t structure and use isc_job_run()
to avoid allocation/deallocation on the StreamDNS hot-path.
2023-04-12 14:10:37 +02:00
Ondřej Surý d27f6f2d68 Accept overquota TCP connection on local thread if possible
If the quota callback is called on a thread matching the socket, call
the TCP accept function directly instead of using isc_async_run() which
allocates-deallocates memory.
2023-04-12 14:10:37 +02:00
Ondřej Surý 0a468e7c9e Make isc_tid() a header-only function
The isc_tid() function is often called on the hot-path and it's the only
function is to return thread_local variable, make the isc_tid() function
a header-only to save several function calls during query-response
processing.
2023-04-12 14:10:37 +02:00
Tom Krizek 9ca151680c Merge branch 'tkrizek/dnsrps-test-replace-egrep' into 'main'
Replace egrep with grep -E in rpz tests

See merge request isc-projects/bind9!7821
2023-04-12 11:55:28 +00:00
Tom Krizek c977b0c81d Replace egrep with grep -E in rpz tests
GNU Grep 3.8 reports the following warnings:

    egrep: warning: egrep is obsolescent; using grep -E
2023-04-12 13:32:46 +02:00
Mark Andrews eb2c8ab213 Merge branch '3975-atomically-increase-rrn-in-add-other-data' into 'main'
atomically increase rrn in add_other_data

Closes #3975

See merge request isc-projects/bind9!7824
2023-04-11 02:45:48 +00:00
Mark Andrews 6cf8a532d4 Atomically increase rrn in add_other_data
'rrn' needs to be treated atomically as it updated from multiple threads.
2023-04-11 10:44:36 +10:00
Michal Nowak ff34a1f117 Merge branch '3916-legacy-test-no-retries-in-resolution_fails' into 'main'
Do not retry in resolution_fails() on timeout

Closes #3916

See merge request isc-projects/bind9!7814
2023-04-06 09:39:22 +00:00
Michal Nowak e05460c813 Do not retry in resolution_fails() on timeout
At the time of test number (19), there were 10 "sending packet to
10.53.0.7" lines in the "legacy/ns1/named.run" file; usually, only seven
are present:

    I:legacy:checking recursive lookup to edns 512 + no tcp server does not cause query loops (19)
    I:legacy:ns1 sent 10 queries to ns7, expected less than 10
    I:legacy:failed

Those three can be attributed to tests "8", "10", and "18", where the
dig of "resolution_fails()" retried after a timeout to succeed with
"status: SERVFAIL" subsequently, as seen in each of
dig.out.test{8,10,18} files.

    ;; communications error to 10.53.0.1#13093: timed out

    ; <<>> DiG 9.19.12-dev <<>> -p 13093 +tcp @10.53.0.1 edns512-notcp. TXT
    ; (1 server found)
    ;; global options: +cmd
    ;; Got answer:
    ;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 5368
    ;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

This retry is unnecessary because "resolution_fails()" considers timeout
a positive result.
2023-04-06 11:35:48 +02:00
Michal Nowak a43519f7b8 Merge branch 'mnowak/looking-for-dig-errors-must-not-fail' into 'main'
Looking for errors in dig output files must not fail

See merge request isc-projects/bind9!7813
2023-04-06 09:03:31 +00:00