]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoUpdate BIND version to 9.17.14
Michał Kępień [Tue, 8 Jun 2021 07:00:49 +0000 (09:00 +0200)] 
Update BIND version to 9.17.14

5 years agoAdd a CHANGES marker
Michał Kępień [Tue, 8 Jun 2021 07:00:49 +0000 (09:00 +0200)] 
Add a CHANGES marker

5 years agoMerge branch 'michal/prepare-documentation-for-bind-9.17.14' into 'v9_17_14-release'
Michał Kępień [Tue, 8 Jun 2021 06:59:38 +0000 (06:59 +0000)] 
Merge branch 'michal/prepare-documentation-for-bind-9.17.14' into 'v9_17_14-release'

Prepare documentation for BIND 9.17.14

See merge request isc-private/bind9!298

5 years agoPrepare release notes for BIND 9.17.14
Michał Kępień [Tue, 8 Jun 2021 06:41:36 +0000 (08:41 +0200)] 
Prepare release notes for BIND 9.17.14

5 years agoReorder release notes
Michał Kępień [Tue, 8 Jun 2021 06:41:36 +0000 (08:41 +0200)] 
Reorder release notes

5 years agoTweak and reword release notes
Michał Kępień [Tue, 8 Jun 2021 06:41:36 +0000 (08:41 +0200)] 
Tweak and reword release notes

5 years agoTweak and reword recent CHANGES entries
Michał Kępień [Tue, 8 Jun 2021 06:41:36 +0000 (08:41 +0200)] 
Tweak and reword recent CHANGES entries

5 years agoRemove leftover release note for GL #2603
Michał Kępień [Tue, 8 Jun 2021 06:41:36 +0000 (08:41 +0200)] 
Remove leftover release note for GL #2603

5 years agoMerge branch 'artem/doh-memmove-null-asan-fix' into 'main'
Artem Boldariev [Wed, 16 Jun 2021 15:51:02 +0000 (15:51 +0000)] 
Merge branch 'artem/doh-memmove-null-asan-fix' into 'main'

Fix undefined behaviour in DoH (passing NULL to memmove())

See merge request isc-projects/bind9!5182

5 years agoFix ASAN error in DoH (passing NULL to memmove())
Artem Boldariev [Mon, 14 Jun 2021 20:25:03 +0000 (23:25 +0300)] 
Fix ASAN error in DoH (passing NULL to memmove())

The warning was produced by an ASAN build:

runtime error: null pointer passed as argument 2, which is declared to
never be null

This commit fixes it by checking if nghttp2_session_mem_send() has
actually returned anything.

5 years agoMerge branch '2755-bad-tkey-samples-in-genzone-sh-comment' into 'main'
Mark Andrews [Wed, 16 Jun 2021 05:54:30 +0000 (05:54 +0000)] 
Merge branch '2755-bad-tkey-samples-in-genzone-sh-comment' into 'main'

Resolve "Bad TKEY samples in genzone.sh comment"

Closes #2755

See merge request isc-projects/bind9!5152

5 years agomake it clear algorithm field is a domain name
Mark Andrews [Mon, 7 Jun 2021 02:53:57 +0000 (12:53 +1000)] 
make it clear algorithm field is a domain name

5 years agoMerge branch '2739-threadsanitizer-data-race-lib-isc-task-c-435-in-task_send-unprotec...
Mark Andrews [Tue, 15 Jun 2021 00:39:03 +0000 (00:39 +0000)] 
Merge branch '2739-threadsanitizer-data-race-lib-isc-task-c-435-in-task_send-unprotected-access-to-task-threadid' into 'main'

Resolve "ThreadSanitizer: data race lib/isc/task.c:435 in task_send (unprotected access to `task->threadid`)"

Closes #2739

See merge request isc-projects/bind9!5149

5 years agoLock access to task->threadid
Mark Andrews [Fri, 4 Jun 2021 04:56:14 +0000 (14:56 +1000)] 
Lock access to task->threadid

5 years agoMerge branch 'artem/dig-large-doh-responses-support' into 'main'
Artem Boldariev [Mon, 14 Jun 2021 09:22:40 +0000 (09:22 +0000)] 
Merge branch 'artem/dig-large-doh-responses-support' into 'main'

Fix BIND and dig to support large DNS messages over DoH, disable XFRs over DoH

See merge request isc-projects/bind9!5148

5 years agoCHANGES
Evan Hunt [Tue, 8 Jun 2021 20:25:01 +0000 (13:25 -0700)] 
CHANGES

Mention that XFRs over DoH are explicitly disabled for now.

5 years agoSet sock->iface and sock->peer properly for layered connection types
Artem Boldariev [Mon, 7 Jun 2021 14:46:08 +0000 (17:46 +0300)] 
Set sock->iface and sock->peer properly for layered connection types

This change sets the mentioned fields properly and gets rid of klusges
added in the times when we were keeping pointers to isc_sockaddr_t
instead of copies. Among other things it helps to avoid a situation
when garbage instead of an address appears in dig output.

5 years agoMake BIND refuse to serve XFRs over DoH
Artem Boldariev [Mon, 7 Jun 2021 13:38:39 +0000 (16:38 +0300)] 
Make BIND refuse to serve XFRs over DoH

We cannot use DoH for zone transfers.  According to RFC8484 a DoH
request contains exactly one DNS message (see Section 6: Definition of
the "application/dns-message" Media Type,
https://datatracker.ietf.org/doc/html/rfc8484#section-6).  This makes
DoH unsuitable for zone transfers as often (and usually!) these need
more than one DNS message, especially for larger zones.

As zone transfers over DoH are not (yet) standardised, nor discussed
in RFC8484, the best thing we can do is to return "not implemented."

Technically DoH can be used to transfer small zones which fit in one
message, but that is not enough for the generic case.

Also, this commit makes the server-side DoH code ensure that no
multiple responses could be attempted to be sent over one HTTP/2
stream. In HTTP/2 one stream is mapped to one request/response
transaction. Now the write callback will be called with failure error
code in such a case.

5 years agoPass an HTTP handle to the read callback when finishing a stream
Artem Boldariev [Fri, 4 Jun 2021 15:30:35 +0000 (18:30 +0300)] 
Pass an HTTP handle to the read callback when finishing a stream

This commit fixes a leftover from an earlier version of the client-side
DoH code when the underlying transport handle was used directly.

5 years agoFix a crash in the client-side DoH code (header processing callback)
Artem Boldariev [Fri, 4 Jun 2021 14:39:58 +0000 (17:39 +0300)] 
Fix a crash in the client-side DoH code (header processing callback)

Support a situation in header processing callback when client side
code could receive a belated response or part of it. That could
happen when the HTTP/2 session was already closed, but there were some
response data from server in flight. Other client-side nghttp2
callbacks code already handled this case.

The bug became apparent after HTTP/2 write buffering was supported,
leading to rare unit test failures.

5 years agoNullify connect.cstream in time and keep track of all client streams
Artem Boldariev [Thu, 3 Jun 2021 13:12:01 +0000 (16:12 +0300)] 
Nullify connect.cstream in time and keep track of all client streams

This commit ensures that sock->h2.connect.cstream gets nullified when
the object in question is deleted. This fixes a nasty crash in dig
exposed when receiving large responses leading to double free()ing.

Also, it refactors how the client-side code keeps track of client
streams (hopefully) preventing from similar errors appearing in the
future.

5 years agoFix BIND to serve large HTTP responses
Artem Boldariev [Tue, 1 Jun 2021 12:16:19 +0000 (15:16 +0300)] 
Fix BIND to serve large HTTP responses

This commit makes NM code to report HTTP as a stream protocol. This
makes it possible to handle large responses properly. Like:

dig +https @127.0.0.1 A cmts1-dhcp.longlines.com

5 years agoMerge branch 'ondrej/bump-clang-dependency-to-llvm-12' into 'main'
Ondřej Surý [Sun, 13 Jun 2021 08:51:12 +0000 (08:51 +0000)] 
Merge branch 'ondrej/bump-clang-dependency-to-llvm-12' into 'main'

Change the LLVM tools version to 12

See merge request isc-projects/bind9!5174

5 years agoUpdate the source code formatting using clang-format-12
Ondřej Surý [Sat, 12 Jun 2021 07:14:40 +0000 (09:14 +0200)] 
Update the source code formatting using clang-format-12

clang-format now tries to keep the type-cast on the same line as the
variable.  Update the formatting.

5 years agoChange the LLVM tools version to 12
Ondřej Surý [Sat, 12 Jun 2021 06:56:37 +0000 (08:56 +0200)] 
Change the LLVM tools version to 12

LLVM 12 stable was released on 15. April 2021, change the default
version to the current stable.

5 years agoMerge branch '2759-fix-no-ds-proofs-for-wildcard-cname-delegations' into 'main'
Michał Kępień [Thu, 10 Jun 2021 08:37:37 +0000 (08:37 +0000)] 
Merge branch '2759-fix-no-ds-proofs-for-wildcard-cname-delegations' into 'main'

Fix "no DS" proofs for wildcard+CNAME delegations

Closes #2759

See merge request isc-projects/bind9!5155

5 years agoAdd release note
Michał Kępień [Thu, 10 Jun 2021 08:13:23 +0000 (10:13 +0200)] 
Add release note

5 years agoAdd CHANGES entry
Michał Kępień [Thu, 10 Jun 2021 08:13:23 +0000 (10:13 +0200)] 
Add CHANGES entry

5 years agoFix "no DS" proofs for wildcard+CNAME delegations
Michał Kępień [Thu, 10 Jun 2021 08:13:23 +0000 (10:13 +0200)] 
Fix "no DS" proofs for wildcard+CNAME delegations

When answering a query requires wildcard expansion, the AUTHORITY
section of the response needs to include NSEC(3) record(s) proving that
the QNAME does not exist.

When a response to a query is an insecure delegation, the AUTHORITY
section needs to include an NSEC(3) proof that no DS record exists at
the parent side of the zone cut.

These two conditions combined trip up the NSEC part of the logic
contained in query_addds(), which expects the NS RRset to be owned by
the first name found in the AUTHORITY section of a delegation response.
This may not always be true, for example if wildcard expansion causes an
NSEC record proving QNAME nonexistence to be added to the AUTHORITY
section before the delegation is added to the response.  In such a case,
named incorrectly omits the NSEC record proving nonexistence of QNAME
from the AUTHORITY section.

The same block of code is affected by another flaw: if the same NSEC
record proves nonexistence of both the QNAME and the DS record at the
parent side of the zone cut, this NSEC record will be added to the
AUTHORITY section twice.

Fix by looking for the NS RRset in the entire AUTHORITY section and
adding the NSEC record to the delegation using query_addrrset() (which
handles duplicate RRset detection).

5 years agoAdd AUTHORITY tests for CNAME-sourced delegations
Michał Kępień [Thu, 10 Jun 2021 08:13:23 +0000 (10:13 +0200)] 
Add AUTHORITY tests for CNAME-sourced delegations

Add a set of system tests which check the contents of the AUTHORITY
section for signed, insecure delegation responses constructed from CNAME
records and wildcards, both for zones using NSEC and NSEC3.

5 years agoMerge branch 'michal/fix-the-variable-checked-by-a-post-load-assertion' into 'main'
Michał Kępień [Thu, 10 Jun 2021 08:03:50 +0000 (08:03 +0000)] 
Merge branch 'michal/fix-the-variable-checked-by-a-post-load-assertion' into 'main'

Fix the variable checked by a post-load assertion

See merge request isc-projects/bind9!5164

5 years agoFix the variable checked by a post-load assertion
Mark Andrews [Thu, 25 Feb 2021 03:44:44 +0000 (14:44 +1100)] 
Fix the variable checked by a post-load assertion

Instead of checking the value of the variable modified two lines earlier
(the number of SOA records present at the apex of the old version of the
zone), one of the RUNTIME_CHECK() assertions in zone_postload() checks
the number of SOA records present at the apex of the new version of the
zone, which is already checked before.  Fix the assertion by making it
check the correct variable.

5 years agoMerge branch 'michal/update-release-checklist' into 'main'
Michał Kępień [Thu, 10 Jun 2021 06:58:54 +0000 (06:58 +0000)] 
Merge branch 'michal/update-release-checklist' into 'main'

Update release checklist

See merge request isc-projects/bind9!5165

5 years agoUpdate release checklist
Michał Kępień [Thu, 10 Jun 2021 06:48:29 +0000 (08:48 +0200)] 
Update release checklist

Add two items to the release checklist to ensure that the start and the
end of the code freeze for each release cycle is announced on
Mattermost.

5 years agoMerge branch '2760-db-unit-test-failure' into 'main'
Mark Andrews [Wed, 9 Jun 2021 22:29:46 +0000 (22:29 +0000)] 
Merge branch '2760-db-unit-test-failure' into 'main'

Resolve "db unit test failure"

Closes #2760

See merge request isc-projects/bind9!5156

5 years agoAdjust acceptable count values
Mark Andrews [Wed, 9 Jun 2021 13:54:14 +0000 (23:54 +1000)] 
Adjust acceptable count values

usleep(100000) can be slightly less than 10ms so allow the count
to reach 11.

5 years agoMerge branch '2720-threadsanitizer-data-race-lib-isc-unix-time-c-110-in-isc_time_isep...
Mark Andrews [Wed, 9 Jun 2021 13:51:10 +0000 (13:51 +0000)] 
Merge branch '2720-threadsanitizer-data-race-lib-isc-unix-time-c-110-in-isc_time_isepoch' into 'main'

Resolve "ThreadSanitizer: data race lib/isc/unix/time.c:110 in isc_time_isepoch"

Closes #2720

See merge request isc-projects/bind9!5124

5 years agoAddress race between zone_settimer and set_key_expiry_warning by
Mark Andrews [Wed, 2 Jun 2021 07:19:42 +0000 (17:19 +1000)] 
Address race between zone_settimer and set_key_expiry_warning by

adding missing lock.

    WARNING: ThreadSanitizer: data race
    Read of size 4 at 0x000000000001 by thread T1 (mutexes: read M1, write M2):
    #0 isc_time_isepoch lib/isc/unix/time.c:110
    #1 zone_settimer lib/dns/zone.c:14649
    #2 dns_zone_maintenance lib/dns/zone.c:6281
    #3 dns_zonemgr_forcemaint lib/dns/zone.c:18190
    #4 view_loaded server.c:9654
    #5 call_loaddone lib/dns/zt.c:301
    #6 doneloading lib/dns/zt.c:575
    #7 zone_asyncload lib/dns/zone.c:2259
    #8 task_run lib/isc/task.c:845
    #9 isc_task_run lib/isc/task.c:938
    #10 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #11 process_netievent lib/isc/netmgr/netmgr.c:934
    #12 process_queue lib/isc/netmgr/netmgr.c:1003
    #13 process_all_queues lib/isc/netmgr/netmgr.c:775
    #14 async_cb lib/isc/netmgr/netmgr.c:804
    #15 <null> <null>
    #16 isc__trampoline_run lib/isc/trampoline.c:191
    #17 <null> <null>

    Previous write of size 4 at 0x000000000001 by thread T2:
    #0 isc_time_set lib/isc/unix/time.c:93
    #1 set_key_expiry_warning lib/dns/zone.c:6430
    #2 del_sigs lib/dns/zone.c:6711
    #3 zone_resigninc lib/dns/zone.c:7113
    #4 zone_maintenance lib/dns/zone.c:11111
    #5 zone_timer lib/dns/zone.c:14588
    #6 task_run lib/isc/task.c:845
    #7 isc_task_run lib/isc/task.c:938
    #8 isc__nm_async_task lib/isc/netmgr/netmgr.c:855
    #9 process_netievent lib/isc/netmgr/netmgr.c:934
    #10 process_queue lib/isc/netmgr/netmgr.c:1003
    #11 process_all_queues lib/isc/netmgr/netmgr.c:775
    #12 async_cb lib/isc/netmgr/netmgr.c:804
    #13 <null> <null>
    #14 isc__trampoline_run lib/isc/trampoline.c:191
    #15 <null> <null>

    SUMMARY: ThreadSanitizer: data race lib/isc/unix/time.c:110 in isc_time_isepoch

5 years agoMerge branch '2690-remove-windows-support-for-bind-9-17-9-18' into 'main'
Ondřej Surý [Wed, 9 Jun 2021 12:59:33 +0000 (12:59 +0000)] 
Merge branch '2690-remove-windows-support-for-bind-9-17-9-18' into 'main'

Completely remove BIND 9 Windows support

Closes #2690

See merge request isc-projects/bind9!5073

5 years agoAdd CHANGES and release note for GL #2690
Ondřej Surý [Thu, 20 May 2021 14:05:11 +0000 (16:05 +0200)] 
Add CHANGES and release note for GL #2690

5 years agoCompletely remove BIND 9 Windows support
Ondřej Surý [Thu, 20 May 2021 13:53:50 +0000 (15:53 +0200)] 
Completely remove BIND 9 Windows support

The Windows support has been completely removed from the source tree
and BIND 9 now no longer supports native compilation on Windows.

We might consider reviewing mingw-w64 port if contributed by external
party, but no development efforts will be put into making BIND 9 compile
and run on Windows again.

5 years agoMerge branch '2725-nsec3param-changes-on-restart' into 'main'
Matthijs Mekking [Wed, 9 Jun 2021 08:29:51 +0000 (08:29 +0000)] 
Merge branch '2725-nsec3param-changes-on-restart' into 'main'

Fix NSEC3 resalt on restart

Closes #2725

See merge request isc-projects/bind9!5126

5 years agoAdd release note and change entry for [#2725]
Matthijs Mekking [Wed, 2 Jun 2021 09:16:10 +0000 (11:16 +0200)] 
Add release note and change entry for [#2725]

5 years agoFix NSEC3 resalting upon restart
Matthijs Mekking [Wed, 2 Jun 2021 08:47:57 +0000 (10:47 +0200)] 
Fix NSEC3 resalting upon restart

When named restarts, it will examine signed zones and checks if the
current denial of existence strategy matches the dnssec-policy. If not,
it will schedule to create a new NSEC(3) chain.

However, on startup the zone database may not be read yet, fooling
BIND that the denial of existence chain needs to be created. This
results in a replacement of the previous NSEC(3) chain.

Change the code such that if the NSEC3PARAM lookup failed (the result
did not return in ISC_R_SUCCESS or ISC_R_NOTFOUND), we will try
again later. The nsec3param structure has additional variables to
signal if the lookup is postponed. We also need to save the signal
if an explicit resalt was requested.

In addition to the two added boolean variables, we add a variable to
store the NSEC3PARAM rdata. This may have a yet to be determined salt
value. We can't create the private data yet because there may be a
mismatch in salt length and the NULL salt value.

5 years agoAdd test for NSEC3PARAM not changed after restart
Matthijs Mekking [Wed, 2 Jun 2021 08:16:50 +0000 (10:16 +0200)] 
Add test for NSEC3PARAM not changed after restart

Add a test case where 'named' is restarted and ensure that an already
signed zone does not change its NSEC3 parameters.

The test case first tests the current zone and saves the used salt
value. Then after restart it checks if the salt (and other parameters)
are the same as before the restart.

This test case changes 'set_nsec3param'. This will now reset the salt
value, and when checking for NSEC3PARAM we will store the salt and
use it when testing the NXDOMAIN response. This does mean that for
every test case we now have to call 'set_nsec3param' explicitly (and
can not omit it because it is the same as the previous zone).

Finally, slightly changed some echo output to make debugging friendlier.

5 years agoMerge branch '2732-pause-the-dbiterator-in-dumptostream' into 'main'
Ondřej Surý [Fri, 4 Jun 2021 09:05:52 +0000 (09:05 +0000)] 
Merge branch '2732-pause-the-dbiterator-in-dumptostream' into 'main'

Pause the dbiterator when dumping the zone to the disk

Closes #2732

See merge request isc-projects/bind9!5150

5 years agoPause the dbiterator when dumping the zone to the disk
Ondřej Surý [Fri, 4 Jun 2021 07:22:09 +0000 (09:22 +0200)] 
Pause the dbiterator when dumping the zone to the disk

When we rewrote the zone dumping to use the separate threadpool, the
dumping would acquire the read lock for the whole time the zone dumping
process is dumping the zone.

When combined with incoming IXFR that tries to acquire the write lock on
the same rwlock, we would end up blocking all the other readers.

In this commit, we pause the dbiterator every time we get next record
and before start dumping it to the disk.

5 years agoMerge branch '2751-serve-stale-tests-false-negative' into 'main'
Mark Andrews [Thu, 3 Jun 2021 08:40:38 +0000 (08:40 +0000)] 
Merge branch '2751-serve-stale-tests-false-negative' into 'main'

Resolve "serve-stale tests false negative"

Closes #2751

See merge request isc-projects/bind9!5143

5 years agoAddress test race condition in serve-stale
Mark Andrews [Thu, 3 Jun 2021 05:42:15 +0000 (15:42 +1000)] 
Address test race condition in serve-stale

the dig.out.test# files could still be being written when the
content greps where being made.

5 years agoMerge branch '2750-provide-more-insight-into-why-the-timer_test-is-failing' into...
Mark Andrews [Thu, 3 Jun 2021 07:31:26 +0000 (07:31 +0000)] 
Merge branch '2750-provide-more-insight-into-why-the-timer_test-is-failing' into 'main'

Resolve "Provide more insight into why the timer_test is failing."

Closes #2750

See merge request isc-projects/bind9!5142

5 years agoReport which assertion failed when calling set_global_error
Mark Andrews [Thu, 3 Jun 2021 01:55:31 +0000 (11:55 +1000)] 
Report which assertion failed when calling set_global_error

5 years agoMerge branch '2724-statschannel-system-test-sometimes-hangs' into 'main'
Mark Andrews [Wed, 2 Jun 2021 22:37:10 +0000 (22:37 +0000)] 
Merge branch '2724-statschannel-system-test-sometimes-hangs' into 'main'

Resolve "statschannel system test sometimes hangs"

Closes #2724

See merge request isc-projects/bind9!5123

5 years agoAdd timeout to url get requests
Mark Andrews [Wed, 2 Jun 2021 06:40:58 +0000 (16:40 +1000)] 
Add timeout to url get requests

to prevent the system test taking forever on failures.

5 years agoMerge branch '2746-fix-the-typo-in-setsockopt_off' into 'main'
Ondřej Surý [Wed, 2 Jun 2021 16:09:48 +0000 (16:09 +0000)] 
Merge branch '2746-fix-the-typo-in-setsockopt_off' into 'main'

Fix copy&paste error in setsockopt_off

Closes #2746

See merge request isc-projects/bind9!5138

5 years agoAdd CHANGES and release note for [GL #2746]
Ondřej Surý [Wed, 2 Jun 2021 15:44:16 +0000 (17:44 +0200)] 
Add CHANGES and release note for [GL #2746]

5 years agoFix copy&paste error in setsockopt_off
Ondřej Surý [Wed, 2 Jun 2021 15:41:17 +0000 (17:41 +0200)] 
Fix copy&paste error in setsockopt_off

Because of copy&paste error the setsockopt_off macro would enable
the socket option instead of disabling it.

5 years agoMerge branch '2540-check-dname-resolution-via-itself' into 'main'
Michał Kępień [Wed, 2 Jun 2021 12:49:05 +0000 (12:49 +0000)] 
Merge branch '2540-check-dname-resolution-via-itself' into 'main'

Check DNAME resolution via itself

Closes #2540

See merge request isc-projects/bind9!5135

5 years agoCheck DNAME resolution via itself
Mark Andrews [Mon, 1 Mar 2021 05:38:36 +0000 (16:38 +1100)] 
Check DNAME resolution via itself

5 years agoMerge branch '2467-add-a-system-test-checking-a-malformed-ixfr' into 'main'
Michał Kępień [Wed, 2 Jun 2021 11:35:55 +0000 (11:35 +0000)] 
Merge branch '2467-add-a-system-test-checking-a-malformed-ixfr' into 'main'

Add a system test checking a malformed IXFR

Closes #2467

See merge request isc-projects/bind9!5132

5 years agoAdd a system test checking a malformed IXFR
Mark Andrews [Wed, 3 Feb 2021 00:10:20 +0000 (11:10 +1100)] 
Add a system test checking a malformed IXFR

Make sure an incoming IXFR containing an SOA record which is not placed
at the apex of the transferred zone does not result in a broken version
of the zone being served by named and/or a subsequent crash.

5 years agoMerge branch 'ondrej/fix-uv_udp_connect-detection' into 'main'
Ondřej Surý [Wed, 2 Jun 2021 09:56:20 +0000 (09:56 +0000)] 
Merge branch 'ondrej/fix-uv_udp_connect-detection' into 'main'

Cleanup the remaining of HAVE_UV_<func> macros

See merge request isc-projects/bind9!5127

5 years agoCleanup the remaining of HAVE_UV_<func> macros
Ondřej Surý [Wed, 2 Jun 2021 09:23:36 +0000 (11:23 +0200)] 
Cleanup the remaining of HAVE_UV_<func> macros

While cleaning up the usage of HAVE_UV_<func> macros, we forgot to
cleanup the HAVE_UV_UDP_CONNECT in the actual code and
HAVE_UV_TRANSLATE_SYS_ERROR and this was causing Windows build to fail
on uv_udp_send() because the socket was already connected and we were
falsely assuming that it was not.

The platforms with autoconf support were not affected, because we were
still checking for the functions from the configure.

5 years agoMerge branch 'ondrej/add-libnghttp2-dev-to-lgtm.yml' into 'main'
Ondřej Surý [Wed, 2 Jun 2021 07:35:39 +0000 (07:35 +0000)] 
Merge branch 'ondrej/add-libnghttp2-dev-to-lgtm.yml' into 'main'

Add libnghttp2-dev to .lgtm.yml

See merge request isc-projects/bind9!5125

5 years agoAdd libnghttp2-dev to .lgtm.yml
Ondřej Surý [Wed, 2 Jun 2021 07:33:27 +0000 (09:33 +0200)] 
Add libnghttp2-dev to .lgtm.yml

The LGTM.com configuration was missing required library, so the
"Extraction" step of the analysis was failing.

5 years agoMerge branch 'artem-http-write-buffering' into 'main'
Artem Boldariev [Tue, 1 Jun 2021 18:28:34 +0000 (18:28 +0000)] 
Merge branch 'artem-http-write-buffering' into 'main'

HTTP/2 write buffering

See merge request isc-projects/bind9!5121

5 years agoHTTP/2 write buffering
Artem Boldariev [Mon, 24 May 2021 11:14:17 +0000 (14:14 +0300)] 
HTTP/2 write buffering

This commit adds the ability to consolidate HTTP/2 write requests if
there is already one in flight. If it is the case, the code will
consolidate multiple subsequent write request into a larger one
allowing to utilise the network in a more efficient way by creating
larger TCP packets as well as by reducing TLS records overhead (by
creating large TLS records instead of multiple small ones).

This optimisation is especially efficient for clients, creating many
concurrent HTTP/2 streams over a transport connection at once.  This
way, the code might create a small amount of multi-kilobyte requests
instead of many 50-120 byte ones.

In fact, it turned out to work so well that I had to add a work-around
to the code to ensure compatibility with the flamethrower, which, at
the time of writing, does not support TLS records larger than two
kilobytes. Now the code tries to flush the write buffer after 1.5
kilobyte, which is still pretty adequate for our use case.

Essentially, this commit implements a recommendation given by nghttp2
library:

https://nghttp2.org/documentation/nghttp2_session_mem_send.html

5 years agoMerge branch '2732-zone-dumping-is-blocking-the-networking-io' into 'main'
Ondřej Surý [Mon, 31 May 2021 13:51:48 +0000 (13:51 +0000)] 
Merge branch '2732-zone-dumping-is-blocking-the-networking-io' into 'main'

Improve the zone dumping impact on the networking

Closes #2732

See merge request isc-projects/bind9!5107

5 years agoAdd CHANGES and release note for [GL #2732]
Ondřej Surý [Thu, 27 May 2021 08:34:57 +0000 (10:34 +0200)] 
Add CHANGES and release note for [GL #2732]

5 years agoIndicate to the kernel that we won't be needing the zone dumps
Ondřej Surý [Thu, 27 May 2021 09:04:37 +0000 (11:04 +0200)] 
Indicate to the kernel that we won't be needing the zone dumps

Add a call to posix_fadvise() to indicate to the kernel, that `named`
won't be needing the dumped zone files any time soon with:

 * POSIX_FADV_DONTNEED - The specified data will not be accessed in the
   near future.

Notes:

 POSIX_FADV_DONTNEED attempts to free cached pages associated with the
 specified region. This is useful, for example, while streaming large
 files. A program may periodically request the kernel to free cached
 data that has already been used, so that more useful cached pages are
 not discarded instead.

5 years agoRefactor zone dumping code to use netmgr async threadpools
Ondřej Surý [Thu, 27 May 2021 07:45:07 +0000 (09:45 +0200)] 
Refactor zone dumping code to use netmgr async threadpools

Previously, dumping the zones to the files were quantized, so it doesn't
slow down network IO processing.  With the introduction of network
manager asynchronous threadpools, we can move the IO intensive work to
use that API and we don't have to quantize the work anymore as it the
file IO won't block anything except other zone dumping processes.

5 years agoAdd isc_task_getnetmgr() function
Ondřej Surý [Thu, 27 May 2021 07:45:07 +0000 (09:45 +0200)] 
Add isc_task_getnetmgr() function

Add a function to pull the attached netmgr from inside the executed
task.  This is needed for any task that needs to call the netmgr API.

5 years agoAdd asynchronous work API to the network manager
Ondřej Surý [Thu, 27 May 2021 07:45:07 +0000 (09:45 +0200)] 
Add asynchronous work API to the network manager

The libuv has a support for running long running tasks in the dedicated
threadpools, so it doesn't affect networking IO.

This commit adds isc_nm_work_enqueue() wrapper that would wraps around
the libuv API and runs it on top of associated worker loop.

The only limitation is that the function must be called from inside
network manager thread, so the call to the function should be wrapped
inside a (bound) task.

5 years agoUse UV_VERSION_HEX to decide whether we need libuv shim functions
Ondřej Surý [Thu, 27 May 2021 11:38:21 +0000 (13:38 +0200)] 
Use UV_VERSION_HEX to decide whether we need libuv shim functions

Instead of having a configure check for every missing function that has
been added in later version of libuv, we now use UV_VERSION_HEX to
decide whether we need the shim or not.

5 years agoAdd uv_os_getenv() and uv_os_setenv() compatibility shims
Ondřej Surý [Thu, 27 May 2021 10:34:06 +0000 (12:34 +0200)] 
Add uv_os_getenv() and uv_os_setenv() compatibility shims

The uv_os_getenv() and uv_os_setenv() functions were introduced in the
libuv >= 1.12.0.  Add simple compatibility shims for older versions.

5 years agoAdd uv_req_get_data() and uv_req_set_data() compatibility shims
Ondřej Surý [Thu, 27 May 2021 09:46:38 +0000 (11:46 +0200)] 
Add uv_req_get_data() and uv_req_set_data() compatibility shims

The uv_req_get_data() and uv_req_set_data() functions were introduced in
libuv >= 1.19.0, so we need to add compatibility shims with older libuv
versions.

5 years agoCleanup the uv_import check
Ondřej Surý [Thu, 27 May 2021 11:05:46 +0000 (13:05 +0200)] 
Cleanup the uv_import check

The uv_import() is not needed anymore, so we can remove the autoconf
check for it.

5 years agoMerge branch 'michal/regenerate-man-pages-with-docutils-0.16' into 'main'
Michał Kępień [Mon, 31 May 2021 12:34:45 +0000 (12:34 +0000)] 
Merge branch 'michal/regenerate-man-pages-with-docutils-0.16' into 'main'

Regenerate man pages with docutils 0.16

See merge request isc-projects/bind9!5119

5 years agoRegenerate man pages with docutils 0.16
Michał Kępień [Mon, 31 May 2021 09:22:52 +0000 (11:22 +0200)] 
Regenerate man pages with docutils 0.16

Commit bdb777b2a2e079ce25f567a316e74436f0584029 updated the man pages
to contents produced using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.17.1

However, sphinx-rtd-theme 0.5.2 is incompatible with versions 0.17+ of
the docutils package.  This problem was addressed in the Docker image
used for building man pages by downgrading the docutils package to
version 0.16.

Regenerate the man pages again, this time using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.16

This is necessary to prevent the "docs" GitLab CI job from failing.

5 years agoMerge branch 'kchen-servestale-fix' into 'main'
Evan Hunt [Sun, 30 May 2021 19:28:59 +0000 (19:28 +0000)] 
Merge branch 'kchen-servestale-fix' into 'main'

Several serve-stale fixes

See merge request isc-projects/bind9!199

5 years agoReuse rdatset->ttl when dumping ancient RRsets
Matthijs Mekking [Thu, 27 May 2021 07:43:21 +0000 (09:43 +0200)] 
Reuse rdatset->ttl when dumping ancient RRsets

Rather than having an expensive 'expired' (fka 'stale_ttl') in the
rdataset structure, that is only used to be printed in a comment on
ancient RRsets, reuse the TTL field of the RRset.

5 years agoSeveral serve-stale improvements
Kevin Chen [Thu, 11 Mar 2021 14:45:44 +0000 (15:45 +0100)] 
Several serve-stale improvements

Commit a83c8cb0afd88d54b9cf67239f2495c9b0391e97 updated masterdump so
that stale records in "rndc dumpdb" output no longer shows 0 TTLs.  In
this commit we change the name of the `rdataset->stale_ttl` field to
`rdataset->expired` to make its purpose clearer, and set it to zero in
cases where it's unused.

Add 'rbtdb->serve_stale_ttl' to various checks so that stale records
are not purged from the cache when they've been stale for RBTDB_VIRTUAL
(300) seconds.

Increment 'ns_statscounter_usedstale' when a stale answer is used.

Note: There was a question of whether 'overmem_purge' should be
purging ancient records, instead of stale ones.  It is left as purging
stale records, since stale records could take up the majority of the
cache.

This submission is copyrighted Akamai Technologies, Inc. and provided
under an MPL 2.0 license.

This commit was originally authored by Kevin Chen, and was updated by
Matthijs Mekking to match recent serve-stale developments.

5 years agoMerge branch '2733-serve-stale-prefetch-crash' into 'main'
Evan Hunt [Sun, 30 May 2021 07:31:38 +0000 (07:31 +0000)] 
Merge branch '2733-serve-stale-prefetch-crash' into 'main'

Fix crash with serve-stale in combination with prefetch

Closes #2733

See merge request isc-projects/bind9!5111

5 years agoAdd CHANGES and notes for [#2733]
Matthijs Mekking [Thu, 27 May 2021 14:04:07 +0000 (16:04 +0200)] 
Add CHANGES and notes for [#2733]

5 years agoadd a system test for the prefetch bug
Evan Hunt [Fri, 28 May 2021 02:55:12 +0000 (19:55 -0700)] 
add a system test for the prefetch bug

Ensure that if prefetch is triggered as a result of a query
restart, it won't have the TRYSTALE_ONTIMEOUT flag set.

5 years agoReset DNS_FETCHOPT_TRYSTALE_ONTIMEOUT on resume
Matthijs Mekking [Thu, 27 May 2021 13:54:13 +0000 (15:54 +0200)] 
Reset DNS_FETCHOPT_TRYSTALE_ONTIMEOUT on resume

Once we resume a query, we should clear DNS_FETCHOPT_TRYSTALE_ONTIMEOUT
from the options to prevent triggering the stale-answer-client-timeout
on subsequent fetches.

If we don't this may cause a crash when for example when prefetch is
triggered after a query restart.

5 years agoMerge branch 'mnowak/add-fedora-34' into 'main'
Michal Nowak [Fri, 28 May 2021 10:50:51 +0000 (10:50 +0000)] 
Merge branch 'mnowak/add-fedora-34' into 'main'

Add Fedora 34

See merge request isc-projects/bind9!5075

5 years agoAdd Fedora 34
Michal Nowak [Thu, 20 May 2021 12:40:47 +0000 (14:40 +0200)] 
Add Fedora 34

5 years agoMerge branch '2731-servestale-dns64' into 'main'
Evan Hunt [Thu, 27 May 2021 18:52:31 +0000 (18:52 +0000)] 
Merge branch '2731-servestale-dns64' into 'main'

fix a crash when using stale data with dns64

Closes #2731

See merge request isc-projects/bind9!5102

5 years agoCHANGES, release note
Evan Hunt [Thu, 27 May 2021 00:41:11 +0000 (17:41 -0700)] 
CHANGES, release note

5 years agoTest with stale timeout cache miss, then fetch completes
Matthijs Mekking [Thu, 27 May 2021 13:44:09 +0000 (15:44 +0200)] 
Test with stale timeout cache miss, then fetch completes

Add a test case where a client request is received and the stale
timeout occurs, but it is not served stale data because there is no entry
in the cache, then is served an authoritative answer once the background
fetch completes. This ensures that a stale timeout only affects a
subsequent response if the client was answered.

5 years agoclean up query correctly if already answered by serve-stale
Evan Hunt [Wed, 26 May 2021 22:35:18 +0000 (15:35 -0700)] 
clean up query correctly if already answered by serve-stale

when a serve-stale answer has been sent, the client continues waiting
for a proper answer. if a final completion event for the client does
arrive, it can just be cleaned up without sending a response, similar
to a canceled fetch.

5 years agoadd a test of DNS64 processing with a stale negative response
Evan Hunt [Wed, 26 May 2021 21:10:50 +0000 (14:10 -0700)] 
add a test of DNS64 processing with a stale negative response

- send a query for an AAAA which will be resolved as a mapped A
- disable authoritative responses
- wait for the negative AAAA response to become stale
- send another query, wait for the stale answer
- re-enable authorative responses so that a real answer arrives
- currently, this triggers an assertion in query.c

5 years agoMerge branch '2708-named-doesn-t-compile-with-gcc-10' into 'main'
Ondřej Surý [Thu, 27 May 2021 06:22:14 +0000 (06:22 +0000)] 
Merge branch '2708-named-doesn-t-compile-with-gcc-10' into 'main'

Resolve "named doesn't compile with GCC 10."

Closes #2708

See merge request isc-projects/bind9!5057

5 years agoRemove priority from attribute constructor/destructor
Mark Andrews [Wed, 19 May 2021 06:38:33 +0000 (16:38 +1000)] 
Remove priority from attribute constructor/destructor

On some platforms, the __attribute__ constructor and destructor won't
take priorities and the compilation failed.  On such platform would be
macOS.  For this reason, the constructor/destructor in the libisc was
reworked to not use priorities, but have a single constructor and
destructor that calls the appropriate routines in correct order.

This commit removes the extra priority because it's now not needed and
it also breaks a compilation on macOS with GCC 10.

5 years agoMerge branch '2282-shutdown-system-test-needs-to-be-tweaked-to-account-for-recent...
Mark Andrews [Thu, 27 May 2021 02:56:57 +0000 (02:56 +0000)] 
Merge branch '2282-shutdown-system-test-needs-to-be-tweaked-to-account-for-recent-netmgr-changes' into 'main'

Resolve ""shutdown" system test needs to be tweaked to account for recent netmgr changes"

Closes #2282

See merge request isc-projects/bind9!4923

5 years agoHandling NoNameservers exception
Diego Fronza [Tue, 20 Apr 2021 15:59:46 +0000 (12:59 -0300)] 
Handling NoNameservers exception

In the shutdown system test multiple queries are sent to a resolver
instance, in the meantime we terminate the same resolver process for
which the queries were sent to, either via rndc stop or a SIGTERM
signal, that means the resolver may not be able to answer all those
queries, since it has initiated the shutdown process.

The dnspython library raises a dns.resolver.NoNameservers exception when
a resolver object fails to receive an answer from the specified list
of nameservers (resolver.nameservers list), we need to handle this
exception as this is something that may happen since we asked the
resolver to terminate, as a result it may not answer clients even if
an answer is available, as the operation will be canceled.

5 years agoMerge branch 'ondrej/revert-OpenBSD-system-wide-connection-timeout' into 'main'
Ondřej Surý [Wed, 26 May 2021 14:24:58 +0000 (14:24 +0000)] 
Merge branch 'ondrej/revert-OpenBSD-system-wide-connection-timeout' into 'main'

Revert "Configure the system-wide TCP connection timeout on OpenBSD"

See merge request isc-projects/bind9!5100

5 years agoRevert "Configure the system-wide TCP connection timeout on OpenBSD"
Ondřej Surý [Wed, 26 May 2021 14:16:00 +0000 (16:16 +0200)] 
Revert "Configure the system-wide TCP connection timeout on OpenBSD"

This reverts commit 8ff15fc0289e7eba5862ae5aca611fa1d327dde5.

5 years agoMerge branch 'marka-missing-initialisations' into 'main'
Mark Andrews [Wed, 26 May 2021 08:52:46 +0000 (08:52 +0000)] 
Merge branch 'marka-missing-initialisations' into 'main'

Add missing initialisations

See merge request isc-projects/bind9!5097

5 years agoAdd missing initialisations
Mark Andrews [Wed, 26 May 2021 07:55:43 +0000 (17:55 +1000)] 
Add missing initialisations

configuring with --enable-mutex-atomics flagged these incorrectly
initialised variables on systems where pthread_mutex_init doesn't
just zero out the structure.