Commit Graph

32726 Commits

Author SHA1 Message Date
Ondřej Surý
64e56a9704 Postpone the isc_app_shutdown() after rndc response has been sent
When `rndc stop` is received, the isc_app_shutdown() was being called
before response to the rndc client has been sent; as the
isc_app_shutdown() also tears down the netmgr, the message was never
sent and rndc would complain about connection being interrupted in the
middle of the transaction.  We now postpone the shutdown after the rndc
response has been sent.
2020-10-22 11:46:58 -07:00
Ondřej Surý
8797e5efd5 Fix the data race when read-writing sock->active by using cmpxchg 2020-10-22 11:46:58 -07:00
Ondřej Surý
5ef71c420f Ignore and don't log ISC_R_NOTCONNECTED from uv_accept()
When client disconnects before the connection can be accepted, the named
would log a spurious log message:

    error: Accepting TCP connection failed: socket is not connected

We now ignore the ISC_R_NOTCONNECTED result code and log only other
errors
2020-10-22 11:37:16 -07:00
Ondřej Surý
f7c82e406e Fix the isc_nm_closedown() to actually close the pending connections
1. The isc__nm_tcp_send() and isc__nm_tcp_read() was not checking
   whether the socket was still alive and scheduling reads/sends on
   closed socket.

2. The isc_nm_read(), isc_nm_send() and isc_nm_resumeread() have been
   changed to always return the error conditions via the callbacks, so
   they always succeed.  This applies to all protocols (UDP, TCP and
   TCPDNS).
2020-10-22 11:37:16 -07:00
Ondřej Surý
6af08d1ca6 Fix the way tcp_send_direct() is used
There were two problems how tcp_send_direct() was used:

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

2. In isc__nm_tcp_send(), when the TCP send is already in the right
   netthread, it uses tcp_send_direct() to send the TCP 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.
2020-10-22 11:37:16 -07:00
Ondřej Surý
d72bc3eb52 Detach the sock->server in uv_close() callback, not before 2020-10-22 11:37:16 -07:00
Ondřej Surý
97b33e5bde Explicitly stop reading before closing the nmtcpsocket
When closing the socket that is actively reading from the stream, the
read_cb() could be called between uv_close() and close callback when the
server socket has been already detached hence using sock->statichandle
after it has been already freed.
2020-10-22 11:37:16 -07:00
Witold Kręcicki
ff0a336d52 Proper handling of socket references in case of TCP conn failure. 2020-10-22 11:37:16 -07:00
Witold Kręcicki
ae9a6befa8 Don't crash if isc_uv_export returns an error in accept_connection.
isc_uv_export can return an error - e.g. EMFILE (from dup), handle this
nicely.
2020-10-22 11:37:16 -07:00
Ondřej Surý
afca2e3b21 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.
2020-10-22 11:37:16 -07:00
Michal Nowak
417632ebba Merge branch 'mnowak/test-coverage-visualization' into 'main'
Enable Test Coverage Visualization in merge requests

See merge request isc-projects/bind9!3875
2020-10-22 12:47:15 +00:00
Michal Nowak
2dabf328c4 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).
2020-10-22 14:46:23 +02:00
Michal Nowak
8d5a7cb0dc 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
2020-10-22 11:29:04 +00:00
Michal Nowak
c453b79a7c Add CHANGES entry 2020-10-22 13:12:16 +02:00
Michal Nowak
7ef268bb4b Drop unused bufferlist code 2020-10-22 13:11:16 +02:00
Michal Nowak
1f6f7ccad6 Drop unused portlist code 2020-10-22 13:11:16 +02:00
Michal Nowak
e67737aa75 Drop unused dbtable code 2020-10-22 13:11:16 +02:00
Michal Nowak
e40097559a 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
2020-10-22 08:16:41 +00:00
Michal Nowak
1319875c46 Ensure use of "echo_i" where possible
In many instances 'echo "I:' construct was used where echo_i function
should have been.
2020-10-22 09:54:24 +02:00
Michał Kępień
beb3ad5494 Merge branch 'v9_17_6-release' into 'main'
Merge 9.17.6 release branch

See merge request isc-projects/bind9!4287
2020-10-22 07:02:41 +00:00
Michał Kępień
3e007be912 Set up release notes for BIND 9.17.7 2020-10-22 08:58:55 +02:00
Michał Kępień
ca7096fd18 Bump BIND_BASELINE_VERSION for ABI checks 2020-10-22 08:58:55 +02:00
Michał Kępień
fadaf3393d Bump BIND_BASELINE_VERSION for respdiff tests 2020-10-22 08:58:55 +02:00
Michał Kępień
58d8c52b09 Update BIND version to 9.17.6 2020-10-22 08:54:32 +02:00
Michał Kępień
b054318491 Add a CHANGES marker 2020-10-22 08:54:32 +02:00
Michał Kępień
9014ff0cc6 Update library API versions 2020-10-22 08:54:32 +02:00
Michał Kępień
3916f81b1e 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
2020-10-22 08:54:32 +02:00
Michał Kępień
2291356b08 Prepare release notes for BIND 9.17.6 2020-10-22 08:54:32 +02:00
Michał Kępień
ef3bd208aa Reorder release notes 2020-10-22 08:54:32 +02:00
Michał Kępień
65f88149de Tweak and reword release notes 2020-10-22 08:54:32 +02:00
Michał Kępień
88cb988cc3 Restore release note for GL #2146 2020-10-22 08:54:32 +02:00
Michał Kępień
35fe33b7d9 Tweak and reword recent CHANGES entries 2020-10-22 08:54:32 +02:00
Michał Kępień
43beb080fc Minor documentation formatting tweaks 2020-10-22 08:54:32 +02:00
Diego dos Santos Fronza
e64e3322a6 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
2020-10-21 15:06:04 +00:00
Diego Fronza
6026cea10c Add CHANGES entry 2020-10-21 12:03:42 -03:00
Diego Fronza
8f5545fa0b 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.
2020-10-21 12:03:42 -03:00
Diego Fronza
b0f61f92b3 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.
2020-10-21 12:03:42 -03:00
Diego Fronza
d727eaae6c Always return address records in additional section for NS queries 2020-10-21 12:03:42 -03:00
Diego Fronza
1cee557993 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.
2020-10-21 12:03:42 -03:00
Michal Nowak
803d12d430 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
2020-10-21 11:15:23 +00:00
Michal Nowak
cf7db2003b 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.
2020-10-21 13:06:52 +02:00
Diego dos Santos Fronza
ef050228f7 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
2020-10-20 13:20:04 +00:00
Diego Fronza
d934513c42 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.
2020-10-20 10:18:28 -03:00
Matthijs Mekking
7350c7555d 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
2020-10-20 11:57:35 +00:00
Matthijs Mekking
6c5ff94218 Don't increment network error stats on UV_EOF
When networking statistics was added to the netmgr (in commit
5234a8e00a), 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.
2020-10-20 10:57:16 +02:00
Mark Andrews
a63ac933bb Merge branch 'marka-fix-not-enough-categories' into 'main'
Tune the minimum number of expected categories.

See merge request isc-projects/bind9!4216
2020-10-15 01:02:49 +00:00
Mark Andrews
0abb49034e Drop the expected minimum number of buckets to 4.
The previous value of 5 produced too many false errors.
2020-10-15 00:40:14 +00:00
Mark Andrews
1a4a7f4671 Merge branch 'marka-rrl-mdig-burst' into 'main'
Try to improve rrl timing

See merge request isc-projects/bind9!4126
2020-10-15 00:37:59 +00:00
Mark Andrews
92cdc7b6c7 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.
2020-10-15 00:05:12 +00:00
Mark Andrews
3562cc7c89 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
2020-10-15 00:01:36 +00:00