]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoFix the way udp_send_direct() is used
Ondřej Surý [Tue, 20 Oct 2020 06:07:44 +0000 (08:07 +0200)] 
Fix the way udp_send_direct() is used

There were two problems how udp_send_direct() was used:

1. The udp_send_direct() can return ISC_R_CANCELED (or translated error
   from uv_udp_send()), but the isc__nm_async_udpsend() wasn't checking
   the error code and not releasing the uvreq in case of an error.

2. In isc__nm_udp_send(), when the UDP send is already in the right
   netthread, it uses udp_send_direct() to send the UDP packet right
   away.  When that happened the uvreq was not freed, and the error code
   was returned to the caller.  We need to return ISC_R_SUCCESS and
   rather use the callback to report an error in such case.

5 years agoMerge branch 'mnowak/test-coverage-visualization' into 'main'
Michal Nowak [Thu, 22 Oct 2020 12:47:15 +0000 (12:47 +0000)] 
Merge branch 'mnowak/test-coverage-visualization' into 'main'

Enable Test Coverage Visualization in merge requests

See merge request isc-projects/bind9!3875

5 years agoEnable Test Coverage Visualization for merge requests
Michal Nowak [Thu, 22 Oct 2020 07:36:17 +0000 (09:36 +0200)] 
Enable Test Coverage Visualization for merge requests

This feature allows GitLab to visualize test coverage information in the
file diff view of merge requests.

This commit makes the gcov CI job depend on the following chain of jobs:

    gcc:buster:amd64 → unit:gcc:buster:amd64 → system:gcc:buster:amd64

The reason for running the last two jobs above sequentially rather than
in parallel is that both of them create *.gcda files (containing
coverage data) in the same locations.  While some way of merging these
files from different job artifact archives could probably be designed
with the help of additional tools, the simplest thing to do is not to
run unit test and system test jobs in parallel, carrying *.gcda files
over between jobs as gcov knows how to append coverage data to existing
*.gcda files.

Also note that test coverage will not be visualized if any of the jobs
in the above dependency chain fails (because the gcov job will not be
run).

5 years agoMerge branch '2060-identify-unused-source-files-via-gcov-ci-job' into 'main'
Michal Nowak [Thu, 22 Oct 2020 11:29:04 +0000 (11:29 +0000)] 
Merge branch '2060-identify-unused-source-files-via-gcov-ci-job' into 'main'

Resolve "Identify unused source files via gcov CI job"

Closes #2060

See merge request isc-projects/bind9!4261

5 years agoAdd CHANGES entry
Michal Nowak [Wed, 21 Oct 2020 14:03:24 +0000 (16:03 +0200)] 
Add CHANGES entry

5 years agoDrop unused bufferlist code
Michal Nowak [Wed, 14 Oct 2020 09:46:03 +0000 (11:46 +0200)] 
Drop unused bufferlist code

5 years agoDrop unused portlist code
Michal Nowak [Mon, 12 Oct 2020 17:21:37 +0000 (19:21 +0200)] 
Drop unused portlist code

5 years agoDrop unused dbtable code
Michal Nowak [Mon, 12 Oct 2020 16:20:58 +0000 (18:20 +0200)] 
Drop unused dbtable code

5 years agoMerge branch '2218-ensure-use-of-echo_i-where-possible-in-system-tests' into 'main'
Michal Nowak [Thu, 22 Oct 2020 08:16:41 +0000 (08:16 +0000)] 
Merge branch '2218-ensure-use-of-echo_i-where-possible-in-system-tests' into 'main'

Ensure use of "echo_i" where possible

Closes #2218

See merge request isc-projects/bind9!4268

5 years agoEnsure use of "echo_i" where possible
Michal Nowak [Thu, 15 Oct 2020 14:27:30 +0000 (16:27 +0200)] 
Ensure use of "echo_i" where possible

In many instances 'echo "I:' construct was used where echo_i function
should have been.

5 years agoMerge branch 'v9_17_6-release' into 'main'
Michał Kępień [Thu, 22 Oct 2020 07:02:41 +0000 (07:02 +0000)] 
Merge branch 'v9_17_6-release' into 'main'

Merge 9.17.6 release branch

See merge request isc-projects/bind9!4287

5 years agoSet up release notes for BIND 9.17.7
Michał Kępień [Thu, 22 Oct 2020 06:58:55 +0000 (08:58 +0200)] 
Set up release notes for BIND 9.17.7

5 years agoBump BIND_BASELINE_VERSION for ABI checks
Michał Kępień [Thu, 22 Oct 2020 06:58:55 +0000 (08:58 +0200)] 
Bump BIND_BASELINE_VERSION for ABI checks

5 years agoBump BIND_BASELINE_VERSION for respdiff tests
Michał Kępień [Thu, 22 Oct 2020 06:58:55 +0000 (08:58 +0200)] 
Bump BIND_BASELINE_VERSION for respdiff tests

5 years agoUpdate BIND version to 9.17.6
Michał Kępień [Mon, 12 Oct 2020 11:45:08 +0000 (13:45 +0200)] 
Update BIND version to 9.17.6

5 years agoAdd a CHANGES marker
Michał Kępień [Mon, 12 Oct 2020 11:45:08 +0000 (13:45 +0200)] 
Add a CHANGES marker

5 years agoUpdate library API versions
Michał Kępień [Mon, 12 Oct 2020 11:45:08 +0000 (13:45 +0200)] 
Update library API versions

5 years agoMerge branch 'michal/prepare-release-notes-for-bind-9.17.6' into 'v9_17_6-release'
Michał Kępień [Mon, 12 Oct 2020 11:41:44 +0000 (11:41 +0000)] 
Merge branch 'michal/prepare-release-notes-for-bind-9.17.6' into 'v9_17_6-release'

Prepare release notes for BIND 9.17.6

See merge request isc-private/bind9!214

5 years agoPrepare release notes for BIND 9.17.6
Michał Kępień [Mon, 12 Oct 2020 11:19:50 +0000 (13:19 +0200)] 
Prepare release notes for BIND 9.17.6

5 years agoReorder release notes
Michał Kępień [Mon, 12 Oct 2020 11:19:50 +0000 (13:19 +0200)] 
Reorder release notes

5 years agoTweak and reword release notes
Michał Kępień [Mon, 12 Oct 2020 11:19:50 +0000 (13:19 +0200)] 
Tweak and reword release notes

5 years agoRestore release note for GL #2146
Michał Kępień [Mon, 12 Oct 2020 11:19:50 +0000 (13:19 +0200)] 
Restore release note for GL #2146

5 years agoTweak and reword recent CHANGES entries
Michał Kępień [Mon, 12 Oct 2020 11:19:50 +0000 (13:19 +0200)] 
Tweak and reword recent CHANGES entries

5 years agoMinor documentation formatting tweaks
Michał Kępień [Mon, 12 Oct 2020 11:19:50 +0000 (13:19 +0200)] 
Minor documentation formatting tweaks

5 years agoMerge branch '1736-stub-zone-foiled-by-minimal-responses' into 'main'
Diego dos Santos Fronza [Wed, 21 Oct 2020 15:06:04 +0000 (15:06 +0000)] 
Merge branch '1736-stub-zone-foiled-by-minimal-responses' into 'main'

Resolve "stub zone foiled by minimal-responses"

Closes #1736

See merge request isc-projects/bind9!4113

5 years agoAdd CHANGES entry
Diego Fronza [Thu, 10 Sep 2020 18:51:46 +0000 (15:51 -0300)] 
Add CHANGES entry

5 years agoAdjusted additional system test (NS, non-root zone)
Diego Fronza [Fri, 2 Oct 2020 15:07:59 +0000 (12:07 -0300)] 
Adjusted additional system test (NS, non-root zone)

After the updates from this branch, BIND now sends glue records for
NS queries even when configured with minimal-responses yes.

5 years agoAdded test for the proposed fix
Diego Fronza [Thu, 10 Sep 2020 18:33:15 +0000 (15:33 -0300)] 
Added test for the proposed fix

This test is very simple, two nameserver instances are created:
    - ns4: master, with 'minimal-responses yes', authoritative
        for example. zone
    - ns5: slave, stub zone

The first thing verified is the transfer of zone data from master
to slave, which should be saved in ns5/example.db.

After that, a query is issued to ns5 asking for target.example.
TXT, a record present in the master database with the "test" string
as content.

If that query works, it means stub zone successfully request
nameserver addresses from master, ns4.example. A/AAAA

The presence of both A/AAAA records for ns4 is also verified in the
stub zone local file, ns5/example.db.

5 years agoAlways return address records in additional section for NS queries
Diego Fronza [Wed, 30 Sep 2020 20:22:39 +0000 (17:22 -0300)] 
Always return address records in additional section for NS queries

5 years agoFix transfer of glue records in stub zones if master has minimal-responses set
Diego Fronza [Thu, 10 Sep 2020 18:09:14 +0000 (15:09 -0300)] 
Fix transfer of glue records in stub zones if master has minimal-responses set

Stub zones don't make use of AXFR/IXFR for the transfering of zone
data, instead, a single query is issued to the master asking for
their nameserver records (NS).

That works fine unless master is configured with 'minimal-responses'
set to yes, in which case glue records are not provided by master
in the answer with nameservers authoritative for the zone, leaving
stub zones with incomplete databases.

This commit fix this problem in a simple way, when the answer with
the authoritative nameservers is received from master (stub_callback),
for each nameserver listed (save_nsrrset), a A and AAAA records for
the name is verified in the additional section, and if not present
a query is created to resolve the corresponsing missing glue.

A struct 'stub_cb_args' was added to keep relevant information for
performing a query, like TSIG key, udp size, dscp value, etc, this
information is borrowed from, and created within function 'ns_query',
where the resolving of nameserver from master starts.

A new field was added to the struct 'dns_stub', an atomic integer,
namely pending_requests, which is used to keep how many queries are
created when resolving nameserver addresses that were missing in
the glue.

When the value of pending_requests is zero we know we can release
resources, adjust zone timers, dump to zone file, etc.

5 years agoMerge branch '1490-run-unit-tests-on-openbsd-in-ci' into 'main'
Michal Nowak [Wed, 21 Oct 2020 11:15:23 +0000 (11:15 +0000)] 
Merge branch '1490-run-unit-tests-on-openbsd-in-ci' into 'main'

Add OpenBSD unit tests to CI

Closes #1490

See merge request isc-projects/bind9!4269

5 years agoRun unit tests on OpenBSD in GitLab CI
Michal Nowak [Mon, 19 Oct 2020 05:47:57 +0000 (07:47 +0200)] 
Run unit tests on OpenBSD in GitLab CI

Unlike other maintained BIND branches, the "main" BIND branch does not
require Kyua for running unit tests, which has been an obstacle for
adding an OpenBSD unit test job to GitLab CI.  Experiments show that a
complete BIND unit test suite completes in a few minutes on OpenBSD and
that unit tests are not as severely affected by OpenBSD performance
issues as system tests are.  Add a GitLab CI job which runs unit tests
on OpenBSD to every pipeline.

5 years agoMerge branch '2195-freebsd-dnstap-system-test-failure' into 'main'
Diego dos Santos Fronza [Tue, 20 Oct 2020 13:20:04 +0000 (13:20 +0000)] 
Merge branch '2195-freebsd-dnstap-system-test-failure' into 'main'

Resolve "FreeBSD dnstap system test failure"

Closes #2195

See merge request isc-projects/bind9!4213

5 years agoFix dnstap system test on FreeBSD
Diego Fronza [Thu, 1 Oct 2020 17:04:05 +0000 (14:04 -0300)] 
Fix dnstap system test on FreeBSD

This commit ensures that dnstap output files captured
by fstrm_capture are properly flushed before any attempt
on reading them with dnstap-read is done.

By reading fstrm-capture source code it was noticed that
signal SIGHUP is used to flush the capture file.

5 years agoMerge branch '2208-tcp4recverr-stat-miscount' into 'main'
Matthijs Mekking [Tue, 20 Oct 2020 11:57:35 +0000 (11:57 +0000)] 
Merge branch '2208-tcp4recverr-stat-miscount' into 'main'

Don't increment network error stats on UV_EOF

Closes #2208

See merge request isc-projects/bind9!4274

5 years agoDon't increment network error stats on UV_EOF
Matthijs Mekking [Tue, 20 Oct 2020 08:57:16 +0000 (10:57 +0200)] 
Don't increment network error stats on UV_EOF

When networking statistics was added to the netmgr (in commit
5234a8e00a6ae1df738020f27544594ccb8d5215), two lines were added that
increment the 'STATID_RECVFAIL' statistic: One if 'uv_read_start'
fails and one at the end of the 'read_cb'.  The latter happens
if 'nread < 0'.

According to the libuv documentation, I/O read callbacks (such as for
files and sockets) are passed a parameter 'nread'. If 'nread' is less
than 0, there was an error and 'UV_EOF' is the end of file error, which
you may want to handle differently.

In other words, we should not treat EOF as a RECVFAIL error.

5 years agoMerge branch 'marka-fix-not-enough-categories' into 'main'
Mark Andrews [Thu, 15 Oct 2020 01:02:49 +0000 (01:02 +0000)] 
Merge branch 'marka-fix-not-enough-categories' into 'main'

Tune the minimum number of expected categories.

See merge request isc-projects/bind9!4216

5 years agoDrop the expected minimum number of buckets to 4.
Mark Andrews [Fri, 2 Oct 2020 02:27:54 +0000 (12:27 +1000)] 
Drop the expected minimum number of buckets to 4.

The previous value of 5 produced too many false errors.

5 years agoMerge branch 'marka-rrl-mdig-burst' into 'main'
Mark Andrews [Thu, 15 Oct 2020 00:37:59 +0000 (00:37 +0000)] 
Merge branch 'marka-rrl-mdig-burst' into 'main'

Try to improve rrl timing

See merge request isc-projects/bind9!4126

5 years agoTry to improve rrl timing
Mark Andrews [Wed, 16 Sep 2020 02:40:52 +0000 (12:40 +1000)] 
Try to improve rrl timing

Add a +burst option to mdig so that we have a second to setup the
mdig calls then they run at the start of the next second.

RRL uses 'queries in a second' as a approximation to
'queries per second'. Getting the bursts of traffic to all happen in
the same second should prevent false negatives in the system test.

We now have a second to setup the traffic in.  Then the traffic should
be sent at the start of the next second.  If that still fails we
should move to +burst=<now+2> (further extend mdig) instead of the
implicit <now+1> as the trigger second.

5 years agoMerge branch '2209-tsan-error-bin-named-controlconf-c-related' into 'main'
Mark Andrews [Thu, 15 Oct 2020 00:01:36 +0000 (00:01 +0000)] 
Merge branch '2209-tsan-error-bin-named-controlconf-c-related' into 'main'

Resolve "TSAN error bin/named/controlconf.c related."

Closes #2209

See merge request isc-projects/bind9!4257

5 years agoComplete the isc_nmhandle_detach() in the worker thread.
Mark Andrews [Mon, 12 Oct 2020 06:51:09 +0000 (17:51 +1100)] 
Complete the isc_nmhandle_detach() in the worker thread.

isc_nmhandle_detach() needs to complete in the same thread
as shutdown_walk_cb() to avoid a race.  Clear the caller's
pointer then pass control to the worker if necessary.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 isc_nmhandle_detach lib/isc/netmgr/netmgr.c:1258:15
    #1 control_command bin/named/controlconf.c:388:3
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Previous read of size 8 at 0x000000000001 by thread T2:
    #0 isc_nm_pauseread lib/isc/netmgr/netmgr.c:1449:33
    #1 recv_data lib/isccc/ccmsg.c:109:2
    #2 isc__nm_tcp_shutdown lib/isc/netmgr/tcp.c:1157:4
    #3 shutdown_walk_cb lib/isc/netmgr/netmgr.c:1515:3
    #4 uv_walk <null>
    #5 process_queue lib/isc/netmgr/netmgr.c:659:4
    #6 process_normal_queue lib/isc/netmgr/netmgr.c:582:10
    #7 process_queues lib/isc/netmgr/netmgr.c:590:8
    #8 async_cb lib/isc/netmgr/netmgr.c:548:2
    #9 <null> <null>

5 years agoMerge branch 'ondrej/little-socket-fixes' into 'main'
Ondřej Surý [Thu, 8 Oct 2020 07:02:15 +0000 (07:02 +0000)] 
Merge branch 'ondrej/little-socket-fixes' into 'main'

Various little fixes in the old socket code

See merge request isc-projects/bind9!4253

5 years agoClean the last remnant of ISC_PLATFORM_HAVEIPV6 macro
Ondřej Surý [Thu, 8 Oct 2020 06:26:28 +0000 (08:26 +0200)] 
Clean the last remnant of ISC_PLATFORM_HAVEIPV6 macro

In set_sndbuf() we were using ISC_PLATFORM_HAVEIPV6 macro that doesn't
exist anymore, because we assume that IPv6 support is always available.

5 years agoAlways set the DF flag (not only when CMSG is available)
Ondřej Surý [Thu, 8 Oct 2020 06:26:28 +0000 (08:26 +0200)] 
Always set the DF flag (not only when CMSG is available)

By mistake, we were setting the DF flag only when CMSG was available for
said platform.

5 years agoMerge branch 'ondrej/clean-netmgr-callback-locks' into 'main'
Ondřej Surý [Thu, 8 Oct 2020 05:42:39 +0000 (05:42 +0000)] 
Merge branch 'ondrej/clean-netmgr-callback-locks' into 'main'

Clean the locking around nm callbacks

See merge request isc-projects/bind9!4220

5 years agoClone the csock in accept_connection(), not in callback
Ondřej Surý [Fri, 18 Sep 2020 10:27:40 +0000 (12:27 +0200)] 
Clone the csock in accept_connection(), not in callback

If we clone the csock (children socket) in TCP accept_connection()
instead of passing the ssock (server socket) to the call back and
cloning it there we unbreak the assumption that every socket is handled
inside it's own worker thread and therefore we can get rid of (at least)
callback locking.

5 years agoChange the isc__nm_tcpdns_stoplistening() to be asynchronous event
Ondřej Surý [Fri, 2 Oct 2020 07:28:29 +0000 (09:28 +0200)] 
Change the isc__nm_tcpdns_stoplistening() to be asynchronous event

The isc__nm_tcpdns_stoplistening() would call isc__nmsocket_clearcb()
that would clear the .accept_cb from non-netmgr thread.  Change the
tcpdns_stoplistening to enqueue ievent that would get processed in the
right netmgr thread to avoid locking.

5 years agoMerge branch '2204-investigate-pipeline-system-test-failure' into 'main'
Mark Andrews [Thu, 8 Oct 2020 05:21:52 +0000 (05:21 +0000)] 
Merge branch '2204-investigate-pipeline-system-test-failure' into 'main'

Resolve "Investigate pipeline system test failure"

Closes #2204

See merge request isc-projects/bind9!4247

5 years agoRestore the dns_message_reset() call before the dns_dispatch_getnext()
Mark Andrews [Wed, 7 Oct 2020 23:55:35 +0000 (10:55 +1100)] 
Restore the dns_message_reset() call before the dns_dispatch_getnext()

This was accidentally lost in the process of moving rmessage from fctx
to query.  Without this dns_message_setclass() will fail.

5 years agoMerge branch 'matthijs-kasp-test-requires-python' into 'main'
Matthijs Mekking [Wed, 7 Oct 2020 15:22:23 +0000 (15:22 +0000)] 
Merge branch 'matthijs-kasp-test-requires-python' into 'main'

The kasp system test requires Python

See merge request isc-projects/bind9!4241

5 years agoThe kasp system test requires Python
Matthijs Mekking [Wed, 7 Oct 2020 07:39:06 +0000 (09:39 +0200)] 
The kasp system test requires Python

Only run the kasp system test if HAVE_PYTHON.

5 years agoMerge branch 'marka-wait-for-isc_nm_stoplistening' into 'main'
Mark Andrews [Wed, 7 Oct 2020 08:15:44 +0000 (08:15 +0000)] 
Merge branch 'marka-wait-for-isc_nm_stoplistening' into 'main'

Wait for isc_nm_stoplistening() to complete

See merge request isc-projects/bind9!4217

5 years agoFix the data race on shutdown/reconfig in control channel
Mark Andrews [Fri, 2 Oct 2020 06:17:51 +0000 (16:17 +1000)] 
Fix the data race on shutdown/reconfig in control channel

The controllistener could be freed before the event posted by
isc_nm_stoplistening() has been processed. This commit adds
a reference counter to the controllistener to determine when
to free the listener.

5 years agoMerge branch '2200-the-fuzzer-dns_message_parser-c-is-leaking-memory' into 'main'
Mark Andrews [Tue, 6 Oct 2020 13:20:36 +0000 (13:20 +0000)] 
Merge branch '2200-the-fuzzer-dns_message_parser-c-is-leaking-memory' into 'main'

Resolve "The fuzzer dns_message_parse.c is leaking memory."

Closes #2200

See merge request isc-projects/bind9!4239

5 years agoinvalidate cctx on error
Mark Andrews [Tue, 6 Oct 2020 12:50:01 +0000 (23:50 +1100)] 
invalidate cctx on error

5 years agoMerge branch 'marka-create_query-fix-REVERSE_INULL' into 'main'
Mark Andrews [Tue, 6 Oct 2020 12:33:56 +0000 (12:33 +0000)] 
Merge branch 'marka-create_query-fix-REVERSE_INULL' into 'main'

Silence Coverity REVERSE_INULL report

Closes #2198

See merge request isc-projects/bind9!4234

5 years agoSilence Coverity REVERSE_INULL report
Mark Andrews [Tue, 6 Oct 2020 06:34:09 +0000 (17:34 +1100)] 
Silence Coverity REVERSE_INULL report

message does not need to be tested to NULL

5 years agoMerge branch 'he32-test-fix' into 'main'
Matthijs Mekking [Tue, 6 Oct 2020 08:28:12 +0000 (08:28 +0000)] 
Merge branch 'he32-test-fix' into 'main'

Avoid a non-standard bashism: use of "==" in "test".

See merge request isc-projects/bind9!4235

5 years agoAvoid a non-standard bashism: use of "==" in "test".
Havard Eidnes [Fri, 2 Oct 2020 12:54:57 +0000 (14:54 +0200)] 
Avoid a non-standard bashism: use of "==" in "test".

5 years agoMerge branch 'marka-render_buf-was-too-big' into 'main'
Mark Andrews [Tue, 6 Oct 2020 07:37:30 +0000 (07:37 +0000)] 
Merge branch 'marka-render_buf-was-too-big' into 'main'

render_buf was too big

See merge request isc-projects/bind9!4231

5 years agorender buf was too big
Mark Andrews [Mon, 5 Oct 2020 22:49:28 +0000 (09:49 +1100)] 
render buf was too big

It was misdeclared as a array of pointers (uint8_t*[]) and there
where too many elements (64 * 1024) instead of (64 * 1024 - 1).

5 years agoMerge branch '2183-dns-flag-day-2020' into 'main'
Ondřej Surý [Mon, 5 Oct 2020 15:13:12 +0000 (15:13 +0000)] 
Merge branch '2183-dns-flag-day-2020' into 'main'

Resolve "DNS Flag Day 2020"

Closes #2183

See merge request isc-projects/bind9!4179

5 years agoAdd text describing the changes done in the MR in more detail
Ondřej Surý [Wed, 30 Sep 2020 16:38:32 +0000 (18:38 +0200)] 
Add text describing the changes done in the MR in more detail

5 years agoEnable DF (don't fragment) flag on listening UDP sockets
Ondřej Surý [Mon, 5 Oct 2020 08:51:40 +0000 (10:51 +0200)] 
Enable DF (don't fragment) flag on listening UDP sockets

This commits uses the isc__nm_socket_dontfrag() helper function to
enable setting DF bit on the outgoing UDP packets.

5 years agoChange the default EDNS buffer size for dig, mdig and host to 1232
Ondřej Surý [Wed, 30 Sep 2020 16:18:05 +0000 (18:18 +0200)] 
Change the default EDNS buffer size for dig, mdig and host to 1232

The dig should behave closely to how the resolver code in `named` work,
so we need to change the buffer size in dig, mdig and host too.

5 years agoAdjust legacy and digdelv tests for default 1232 EDNS Buffer Size
Ondřej Surý [Wed, 23 Sep 2020 14:36:44 +0000 (16:36 +0200)] 
Adjust legacy and digdelv tests for default 1232 EDNS Buffer Size

* the legacy test with -T maxudp512 will just fail, e.g. if the packets
  larger than 512 octets are dropped along the path, the proper response
  is to fail

* digdelv test was just expecting default server EDNS buffer size to be
  4096, the test needed only slight adjustment

5 years agoSimplify the EDNS buffer size logic for DNS Flag Day 2020
Ondřej Surý [Wed, 23 Sep 2020 12:47:26 +0000 (14:47 +0200)] 
Simplify the EDNS buffer size logic for DNS Flag Day 2020

The DNS Flag Day 2020 aims to remove the IP fragmentation problem from
the UDP DNS communication.  In this commit, we implement the required
changes and simplify the logic for picking the EDNS Buffer Size.

1. The defaults for `edns-udp-size`, `max-udp-size` and
   `nocookie-udp-size` have been changed to `1232` (the value picked by
   DNS Flag Day 2020).

2. The probing heuristics that would try 512->4096->1432->1232 buffer
   sizes has been removed and the resolver will always use just the
   `edns-udp-size` value.

3. Instead of just disabling the PMTUD mechanism on the UDP sockets, we
   now set IP_DONTFRAG (IPV6_DONTFRAG) flag.  That means that the UDP
   packets won't get ever fragmented.  If the ICMP packets are lost the
   UDP will just timeout and eventually be retried over TCP.

5 years agoMerge branch 'ondrej/refactor-setsockopt' into 'main'
Ondřej Surý [Mon, 5 Oct 2020 14:11:55 +0000 (14:11 +0000)] 
Merge branch 'ondrej/refactor-setsockopt' into 'main'

Refactor the setsockopt() code in network manager into helper functions

See merge request isc-projects/bind9!4227

5 years agoSplit reusing the addr/port and load-balancing socket options
Ondřej Surý [Mon, 5 Oct 2020 11:14:04 +0000 (13:14 +0200)] 
Split reusing the addr/port and load-balancing socket options

The SO_REUSEADDR, SO_REUSEPORT and SO_REUSEPORT_LB has different meaning
on different platform. In this commit, we split the function to set the
reuse of address/port and setting the load-balancing into separate
functions.

The libuv library already have multiplatform support for setting
SO_REUSEADDR and SO_REUSEPORT that allows binding to the same address
and port, but unfortunately, when used after the load-balancing socket
options have been already set, it overrides the previous setting, so we
need our own helper function to enable the SO_REUSEADDR/SO_REUSEPORT
first and then enable the load-balancing socket option.

5 years agoUse uv_os_sock_t instead of uv_os_fd_t for sockets
Ondřej Surý [Mon, 5 Oct 2020 10:25:19 +0000 (12:25 +0200)] 
Use uv_os_sock_t instead of uv_os_fd_t for sockets

On POSIX based systems both uv_os_sock_t and uv_os_fd_t are both typedef
to int.  That's not true on Windows, where uv_os_sock_t is SOCKET and
uv_os_fd_t is HANDLE and they differ in level of indirection.

5 years agoRefactor isc__nm_socket_freebind() to take fd and sa_family as args
Ondřej Surý [Mon, 5 Oct 2020 09:17:52 +0000 (11:17 +0200)] 
Refactor isc__nm_socket_freebind() to take fd and sa_family as args

The isc__nm_socket_freebind() has been refactored to match other
isc__nm_socket_...() helper functions and take uv_os_fd_t and
sa_family_t as function arguments.

5 years agoAdd helper function to enable DF (don't fragment) flag on UDP sockets
Ondřej Surý [Mon, 5 Oct 2020 08:51:40 +0000 (10:51 +0200)] 
Add helper function to enable DF (don't fragment) flag on UDP sockets

This commits add isc__nm_socket_dontfrag() helper functions.

5 years agoAdd SO_REUSEPORT and SO_INCOMING_CPU helper functions
Ondřej Surý [Mon, 5 Oct 2020 08:40:02 +0000 (10:40 +0200)] 
Add SO_REUSEPORT and SO_INCOMING_CPU helper functions

The setting of SO_REUSE**** and SO_INCOMING_CPU have been moved into a
separate helper functions.

5 years agoMerge branch '1749-rndc-dnssec-rollover' into 'main'
Matthijs Mekking [Mon, 5 Oct 2020 09:46:48 +0000 (09:46 +0000)] 
Merge branch '1749-rndc-dnssec-rollover' into 'main'

Resolve "rndc trigger rollover"

Closes #1749

See merge request isc-projects/bind9!4004

5 years agoUse default algorithm in kasp test if possible
Matthijs Mekking [Fri, 4 Sep 2020 14:35:01 +0000 (16:35 +0200)] 
Use default algorithm in kasp test if possible

These tests don't require a specific algorithm so they should use
the DEFAULT_ALGORITHM from 'conf.sh.common'.

5 years agoUse explicit result codes for 'rndc dnssec' cmd
Matthijs Mekking [Fri, 4 Sep 2020 09:42:52 +0000 (11:42 +0200)] 
Use explicit result codes for 'rndc dnssec' cmd

It is better to add new result codes than to overload existing codes.

5 years agoVarious rndc dnssec -checkds fixes
Matthijs Mekking [Mon, 24 Aug 2020 08:05:28 +0000 (10:05 +0200)] 
Various rndc dnssec -checkds fixes

While working on 'rndc dnssec -rollover' I noticed the following
(small) issues:

- The key files where updated with hints set to "-when" and that
  should always be "now.
- The kasp system test did not properly update the test number when
  calling 'rndc dnssec -checkds' (and ensuring that works).
- There was a missing ']' in the rndc.c help output.

5 years agoTest rndc rollover inactive key
Matthijs Mekking [Mon, 24 Aug 2020 08:03:02 +0000 (10:03 +0200)] 
Test rndc rollover inactive key

When users (accidentally) try to roll an inactive key, throw an error.

5 years agoAdd rndc dnssec -rollover command
Matthijs Mekking [Fri, 21 Aug 2020 13:38:00 +0000 (15:38 +0200)] 
Add rndc dnssec -rollover command

This command is similar in arguments as -checkds so refactor the
'named_server_dnssec' function accordingly.  The only difference
are that:

- It does not take a "publish" or "withdrawn" argument.
- It requires the key id to be set (add a check to make sure).

Add tests that will trigger rollover immediately and one that
schedules a test in the future.

5 years agoAdd manual key rollover logic
Matthijs Mekking [Fri, 21 Aug 2020 13:31:57 +0000 (15:31 +0200)] 
Add manual key rollover logic

Add to the keymgr a function that will schedule a rollover. This
basically means setting the time when the key needs to retire,
and updating the key lifetime, then update the state file. The next
time that named runs the keymgr the new lifetime will be taken into
account.

5 years agoMerge branch '1870-fix-after-backport-to-9_11_s' into 'main'
Matthijs Mekking [Mon, 5 Oct 2020 08:47:07 +0000 (08:47 +0000)] 
Merge branch '1870-fix-after-backport-to-9_11_s' into 'main'

Change condition for rndc dumpdb -expired

See merge request isc-projects/bind9!4219

5 years agoChange condition for rndc dumpdb -expired
Matthijs Mekking [Fri, 2 Oct 2020 07:12:23 +0000 (09:12 +0200)] 
Change condition for rndc dumpdb -expired

After backporting #1870 to 9.11-S I saw that the condition check there
is different than in the main branch. In 9.11-S "stale" can mean
stale and serve-stale, or not active (awaiting cleanup). In 9.16 and
later versions, "stale" is stale and serve-stale, and "ancient" means
not active (awaiting cleanup). An "ancient" RRset is one that is not
active (TTL expired) and is not eligble for serve-stale.

Update the condition for rndc dumpdb -expired to closer match what is
in 9.11-S.

5 years agoMerge branch '2171-dnssec-policy-weird-algo-15-bug' into 'main'
Matthijs Mekking [Fri, 2 Oct 2020 08:06:45 +0000 (08:06 +0000)] 
Merge branch '2171-dnssec-policy-weird-algo-15-bug' into 'main'

Resolve "dnssec-policy behaviour for algorithm 15 keys different to algorithm 8 keys"

Closes #2171

See merge request isc-projects/bind9!4199

5 years agoFix a timing issue in kasp system test
Matthijs Mekking [Thu, 1 Oct 2020 09:07:05 +0000 (11:07 +0200)] 
Fix a timing issue in kasp system test

Sometimes, not all keys have been created in time before 'check_keys'
is called. Run a 'retry_quiet' on checking the number of keys before
continuing checking the key data.

5 years agoFix kasp min key size bug
Matthijs Mekking [Thu, 1 Oct 2020 09:05:01 +0000 (11:05 +0200)] 
Fix kasp min key size bug

The minimal size for RSASHA1, RSASHA256 is 512, but due to bad
assignment it was set to 1024.

5 years agoTest migration to dnssec-policy with views
Matthijs Mekking [Wed, 30 Sep 2020 08:06:37 +0000 (10:06 +0200)] 
Test migration to dnssec-policy with views

This test case is unrelated to the fix for #2171 but was added to
reproduce the problem.

5 years agoMinor fix in kasp system test
Matthijs Mekking [Wed, 30 Sep 2020 08:04:27 +0000 (10:04 +0200)] 
Minor fix in kasp system test

The 'wait_for_nsec' does not need to add TSIG because it calls
'dig_with_opts' and that already checks for TSIG.

5 years agoAdd change and note for #2171
Matthijs Mekking [Wed, 30 Sep 2020 08:03:43 +0000 (10:03 +0200)] 
Add change and note for #2171

This is a bug that needs to be noted.

5 years agoFix Ed25519 and Ed448 in dnssec-policy keymgr
Matthijs Mekking [Wed, 30 Sep 2020 07:57:45 +0000 (09:57 +0200)] 
Fix Ed25519 and Ed448 in dnssec-policy keymgr

The kasp code had bad implicit size values for the cryptographic
algorithms Ed25519 and Ed448. When creating keys they would never
match the dnssec-policy, leading to new attempts to create keys.

These algorithms were previously not yet added to the system tests,
due to lack of availability on some systems.

5 years agoAdd kasp tests for Ed25519 and Ed448
Matthijs Mekking [Wed, 30 Sep 2020 07:53:19 +0000 (09:53 +0200)] 
Add kasp tests for Ed25519 and Ed448

Use the testcrypto script to see if these algorithms are supported by
openssl. If so, add the specific configuration to the named.conf file
and touch a file to indicate support. If the file exists, the
corresponding setup and tests are performed.

5 years agoMerge branch '2139-rrset-order-fixes-and-cleanups' into 'main'
Michał Kępień [Fri, 2 Oct 2020 06:50:02 +0000 (06:50 +0000)] 
Merge branch '2139-rrset-order-fixes-and-cleanups' into 'main'

"rrset-order" fixes and cleanups

Closes #2139

See merge request isc-projects/bind9!4195

5 years agoAdd CHANGES entries
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Add CHANGES entries

5 years agoRework "rrset-order" documentation
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Rework "rrset-order" documentation

Certain parts of the existing documentation for the "rrset-order"
statement are incorrect, others are ambiguous.  Rework the relevant
section of the ARM to make it clear and up-to-date with the source code.

5 years agoAdd tests for "order none" RRset ordering rules
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Add tests for "order none" RRset ordering rules

Make sure "order none" RRset ordering rules are tested in the
"rrsetorder" system test just like all other rule types are.  As the
check for the case of no "rrset-order" rule matching a given RRset also
tests "order none" (rather than "order random", as the test code may
suggest at first glance), replace the test code for that case so that it
matches other "order none" tests.

5 years agoAllow "order none" in "rrset-order" rules
Michał Kępień [Fri, 2 Oct 2020 06:41:43 +0000 (08:41 +0200)] 
Allow "order none" in "rrset-order" rules

named-checkconf treats the following configuration as valid:

    options {
        rrset-order {
            order none;
        };
    };

Yet, the above configuration causes named to crash on startup with:

    order.c:74: REQUIRE(mode == 0x00000800 || mode == 0x00000400 || mode == 0x00800000) failed, back trace

Add DNS_RDATASETATTR_NONE to the list of RRset ordering modes accepted
by dns_order_add() to allow "order none" to be used in "rrset-order"
rules.  This both prevents the aforementioned crashes and addresses the
discrepancy between named-checkconf and named.

5 years agoMerge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime' into 'main'
Mark Andrews [Thu, 1 Oct 2020 12:46:00 +0000 (12:46 +0000)] 
Merge branch '2112-allow-task_test-subtests-to-be-selected-at-runtime' into 'main'

Resolve "Allow task_test and rdata_tests subtests to be selected at runtime."

Closes #2112

See merge request isc-projects/bind9!4059

5 years agoAdd the ability select individual tests to rdata_test
Mark Andrews [Fri, 11 Sep 2020 04:17:36 +0000 (14:17 +1000)] 
Add the ability select individual tests to rdata_test

5 years agoAdd the ability to print out the list of test names (-l)
Mark Andrews [Tue, 8 Sep 2020 00:38:24 +0000 (10:38 +1000)] 
Add the ability to print out the list of test names (-l)

5 years agoAdd the ability to select tests to run
Mark Andrews [Wed, 2 Sep 2020 08:22:21 +0000 (18:22 +1000)] 
Add the ability to select tests to run

task_test [-t <test_name>]