2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00
Commit Graph

39997 Commits

Author SHA1 Message Date
Ondřej Surý
759a977a67 Convert dns_message reference counting to ISC_REFCOUNT macros
Unify the dns_message reference counting to use ISC_REFCOUNT_{IMPL,DECL}
macros to reduce the code duplicity and add reference count tracing.
2023-09-24 10:09:04 +02:00
Ondřej Surý
3340c82b99 Improve isc_refcount with initializer and implicit destroy
Add ISC_REFCOUNT_INITIALIZER(x) macro and implicitly call
isc_refcount_destroy() in the ISC_REFCOUNT_IMPL() macros
to reduce code duplicities.
2023-09-24 10:08:56 +02:00
Arаm Sаrgsyаn
6adc0be124 Merge branch 'aram/statschannel-expose-precursory-soa-request-state' into 'main'
Add the "Refresh SOA" state for the incoming zone transfers and improve the "Duration" field

See merge request isc-projects/bind9!8305
2023-09-22 12:40:53 +00:00
Aram Sargsyan
e905a05b3e Add a CHANGES note for [GL !8305] 2023-09-22 11:47:26 +00:00
Aram Sargsyan
93088fbf8b Fix the incoming transfers' "Needs Refresh" state in stats channel
The "Needs Refresh" flag is exposed in two places in the statistics
channel: first - there is a state called "Needs Refresh", when the
process hasn't started yet, but the zone needs a refresh, and second
- there there is a field called "Additional Refresh Queued", when the
process is ongoing, but another refresh is queued for the same zone.

The DNS_ZONEFLG_NEEDREFRESH flag, however, is set only when there is
an ongoing zone transfer and a new notify is received. That is, the
flag is not set for the first case above.

In order to fix the issue, use the DNS_ZONEFLG_NEEDREFRESH flag only
when the zone transfer is running, otherwise, decide whether a zone
needs a refresh using its refresh and expire times.
2023-09-22 11:47:26 +00:00
Aram Sargsyan
621a1461d9 xfrin: rename XFRST_INITIALSOA to XFRST_ZONEXFRREQUEST
The XFRST_INITIALSOA state in the xfrin module is named like that,
because the first RR in a zone transfer must be SOA. However, the
name of the state is a bit confusing (especially when exposed to
the users with statistics channel), because it can be mistaken with
the refresh SOA request step, which takes place before the zone
transfer starts.

Rename the state to XFRST_ZONEXFRREQUEST (i.e. Zone Transfer Request).
During that step the state machine performs several operations -
establishing a connection, sending a request, and receiving/parsing
the first RR in the answer.
2023-09-22 11:47:26 +00:00
Aram Sargsyan
dee829d9dc Show the local and remote addresses for the "Refresh SOA" query
Currently in the statsistics channel's incoming zone transfers list
the local and remote addresses are shown only when the zone transfer
is already running. Since we have now introduced the "Refresh SOA"
state, which shows the state of the SOA query before the zone transfer
is started, this commit implements a feature to show the local and
remote addresses for the SOA query, when the state is "Refresh SOA".
2023-09-22 11:26:11 +00:00
Aram Sargsyan
979b86ecb9 Improve the "Duration (s)" field of the incoming xfers in stats channel
Improve the "Duration (s)" field, so that it can show the duration of
all the major states of an incoming zone transfer process, while they
are taking place. In particular, it will now show the duration of the
"Pending", "Refresh SOA" and "Deferred" states too, before the actual
zone transfer starts.
2023-09-22 11:24:49 +00:00
Aram Sargsyan
a3916e4ed2 Add the "Refresh SOA" state for the incoming zone transfers
With adding this state to the statistics channel, it can now show
the zone transfer in this state instead of as "Pending" when the
zone.c module is performing a refresh SOA request, before actually
starting the transfer process. This will help to understand
whether the process is waiting because of the rate limiter (i.e.
"Pending"), or the rate limiter is passed and it is now waiting for
the refresh SOA query to complete or time out.
2023-09-22 11:05:52 +00:00
Arаm Sаrgsyаn
9b6949e8ec Merge branch 'aram/statschannel-expose-xfrin-soa-transport' into 'main'
Expose the SOA query transport type used before/during XFR

See merge request isc-projects/bind9!8240
2023-09-22 10:59:30 +00:00
Aram Sargsyan
e92d1eeafc Check zone transfer transports in the statistics channel
Add two more secondary zones to ns3 to be transferred from ns1,
using its IPv6 address for which the 'tcp-only' is set to 'yes'.
Check the statistics channel's incoming zone transfers information
to confirm that the expected transports were used for each of the
SOA query cases (UDP, TCP, TLS), and also for zone transfers (TCP,
TLS).
2023-09-22 09:56:33 +00:00
Aram Sargsyan
8f4f82e018 Add a CHANGES note for [GL !8240] 2023-09-22 09:56:33 +00:00
Aram Sargsyan
8e2273afce Expose the SOA query transport type used before/during XFR
Add a new field in the incoming zone transfers section of the
statistics channel to show the transport used for the SOA request.

When the transfer is started beginning from the XFRST_SOAQUERY state,
it means that the SOA query will be performed by xfrin itself, using
the same transport. Otherwise, it means that the SOA query was already
performed by other means (e.g. by zone.c:soa_query()), and, in that
case, we use the SOA query transport type information passed by the
'soa_transport_type' argument, when the xfrin object was created.
2023-09-22 09:56:33 +00:00
Arаm Sаrgsyаn
2eb8afde52 Merge branch '3883-expose-data-about-transfers-in-progress' into 'main'
Draft: Implement exposing data about zone transfers in progress

Closes #3883

See merge request isc-projects/bind9!7984
2023-09-22 09:40:23 +00:00
Mark Andrews
a60e6837fb Wait for slow zone transfer to complete before ending test
This allows the statistics channel to be viewed in a browser while
the transfer is in progress.  Also set the transfer format to
one-answer to extend the amount of time the re-transfer takes.

When running the statschannel test on its own, use
<http://10.53.0.3:5304/xml/v3/xfrins> to see the output.

Note: the port is subject to future change.
2023-09-22 08:52:13 +00:00
Mark Andrews
bed4e36c86 Provide thread safe access to dns_xfrin_t state
dns_xfrin_t state may be accessed from different threads when
when reporting transfer state.  Ensure access is thread safe by
using atomics and locks where appropriate.
2023-09-22 08:52:13 +00:00
Aram Sargsyan
42f41f003e Add CHANGES and release notes for [GL #3883] 2023-09-22 08:52:12 +00:00
Aram Sargsyan
2f523462b8 Document zone transfers in statschannel
List the JSON and XML URLs in ARM for retrieving the incoming zone
transfers information from the statistics channel.
2023-09-22 08:51:45 +00:00
Aram Sargsyan
c929127b73 Add a test case for checking zone transfers in statschannel
Use the named -T transferslowly test options to slow down a zone
transfer from the primary server, and test that it's correctly
exposed in the statistics channel of the secondary server, while
it's in-progress.
2023-09-22 08:51:45 +00:00
Aram Sargsyan
3e65dc12f7 Implement exposing data about zone transfers in progress
The data about currently in-progress zone transfers is exposed
using the statistics channel in both XML and JSON formats.
2023-09-22 08:51:45 +00:00
Aram Sargsyan
bc12bcaf46 Implement various dns_xfrin_get*() functions
The information provided by those function will be needed and
used by the statistics channel in a follow-up commit.
2023-09-22 08:51:45 +00:00
Aram Sargsyan
826392f8c8 Implement dns_zone_getxfr()
The function is needed to get an attached xfrin and its current
state in statschannel.c for providing xfrin information in the
statistics channel.
2023-09-22 08:51:45 +00:00
Aram Sargsyan
35fc773632 dns_transport: use const arguments in getters when possible
In some dns_transport getter functions it's possible to use a
const dns_transport_t as the first argument instead of just
dns_transport_t. Convert the function prototypes to use const.
2023-09-22 08:51:45 +00:00
Ondřej Surý
baacd2af44 Merge branch '4327-minor-warning-about-ctype-h-function' into 'main'
Add semantic patch to explicitly cast chars to unsigned for ctype.h

Closes #4327

See merge request isc-projects/bind9!8325
2023-09-22 06:30:06 +00:00
Ondřej Surý
0e49a8422f Add CHANGES note for [GL #4327] 2023-09-22 08:29:17 +02:00
Ondřej Surý
29caa6d1f0 Explicitly cast chars to unsigned chars for <ctype.h> functions
Apply the semantic patch to catch all the places where we pass 'char' to
the <ctype.h> family of functions (isalpha() and friends, toupper(),
tolower()).
2023-09-22 08:29:17 +02:00
Ondřej Surý
5ec65ab5d0 Add semantic patch to explicitly cast chars to unsigned for ctype.h
Add a semantic patch to catch all the places where we pass 'char' to the
<ctype.h> family of functions (isalpha() and friends, toupper(),
tolower()).  While it generally works because the way how these
functions are constructed in the libc, it's safer to do the explicit
cast.
2023-09-22 08:29:17 +02:00
Michał Kępień
a0ab9c6c9e Merge branch 'mnowak/add-cve-ref-role' into 'main'
Add a Sphinx role for linking CVEs to the ISC Knowledgebase

See merge request isc-projects/bind9!8260
2023-09-21 12:22:49 +00:00
Michal Nowak
41b857e567 Add a Sphinx role for linking CVEs to the ISC Knowledgebase
The new :cve: Sphinx role takes a CVE number as an argument and creates
a hyperlink to the relevant ISC Knowledgebase document that might have
more up-to-date or verbose information than the relevant release note.
This makes reaching ISC Knowledgebase pages directly from the release
notes easier.

Make all CVE references in the release notes use the new Sphinx role.
2023-09-21 14:18:02 +02:00
Michał Kępień
c201835719 Merge branch 'michal/update-sphinx-and-sphinx_rtd_theme' into 'main'
Update Sphinx and sphinx_rtd_theme

See merge request isc-projects/bind9!8322
2023-09-20 15:20:25 +00:00
Michał Kępień
2f879cdec3 Update Sphinx and sphinx_rtd_theme
Update Sphinx-related Python packages to their current versions pulled
in by "pip install sphinx-rtd-theme" run in a fresh virtual environment.
2023-09-20 17:18:24 +02:00
Michał Kępień
fc0ee66063 Merge tag 'v9.19.17' 2023-09-20 16:45:47 +02:00
Ondřej Surý
37a8cf7dae Merge branch 'ondrej/remove-isc_hash_function' into 'main'
Use incremental hashing in the isc_sockaddr_hash() function

See merge request isc-projects/bind9!8298
2023-09-19 18:48:56 +00:00
Ondřej Surý
4cf4cc484d Use the new isc_sockaddr_hash_ex() to fix QID table hashing
The QID table hashing used a custom merging of the sockaddr, port and id
into a single hashvalue.  Normalize the QID table hashing function to
use isc_hash32 API for all the values.
2023-09-19 19:56:33 +02:00
Ondřej Surý
3230c8e369 Add isc_sockaddr_hash_ex that can be used in incremental hashing
Add a sockaddr hashing function that can be used as part of incremental
hashing.
2023-09-19 19:56:33 +02:00
Ondřej Surý
9f40eee0a8 Remove isc_hash_function macro
The last two users of 64-bit isc_hash_function() macro were removed in
the previous commits, remove the macro as well.
2023-09-19 19:56:33 +02:00
Ondřej Surý
1653fa61c7 Use 32-bit hashing in isc memory debugging
Switch from 64-bit isc_hash_function() to 32-bit isc_hash32() as we were
using the 32-bit value only anyway.
2023-09-19 19:51:51 +02:00
Ondřej Surý
9d326aaba3 Use incremental hashing in the isc_sockaddr_hash() function
Instead of copying address back and forth when hashing addr+port, we can
use incremental hashing.  Additionally, switch from 64-bit
isc_hash_function to 32-bit isc_hash32() as the resulting value is
32-bit.
2023-09-19 19:51:51 +02:00
Ondřej Surý
17b08fa614 Merge branch '4311-remove-sockaddr_unix' into 'main'
Completely remove the Unix Domain Socket support from BIND 9

Closes #4311

See merge request isc-projects/bind9!8292
2023-09-19 17:29:53 +00:00
Ondřej Surý
da4ba38c81 Add CHANGES and release note for [GL #4311] 2023-09-19 18:51:51 +02:00
Ondřej Surý
26685ce5a8 Remove Raw and FDWatch type of socket statistics
The isc_sockstatscounter_raw* and isc_sockstatscounter_fdwatch was just
a dead code and those counters were not used anywhere.  Remove them.
2023-09-19 18:51:35 +02:00
Ondřej Surý
7aebbec653 Completely remove the Unix Domain Socket support from BIND 9
The Unix Domain Sockets support in BIND 9 has been completely disabled
since BIND 9.18 and it has been a fatal error since then.  Cleanup the
code and the documentation that suggest that Unix Domain Sockets are
supported.
2023-09-19 18:51:35 +02:00
Tom Krizek
652f2725a0 Merge branch '4312-pytest-symlink-name-collision' into 'main'
Rename convenience symlink to pytest artifacts

Closes #4312

See merge request isc-projects/bind9!8306
2023-09-19 15:59:03 +00:00
Tom Krizek
fd13dfb097 Rename convenience symlink to pytest artifacts
The previous symlink name convention was prone to name collisions If a
system test contained both a shell test and a pytest module of the same
name (e.g. dnstap test has both tests.sh and tests_dnstap.py), then
these would have the same convenience symlink, which could cause test
setup issues as well as confusion when examining test artifacts.

Update the naming convention to include the full pytest module name.
This results in a slightly more verbose names for shell tests (e.g.
dnstap_sh_dnstap instead of the previous dnstap_dnstap), but it removes
the chance of a collision.
2023-09-19 17:20:32 +02:00
Tom Krizek
f441e68bb3 Merge branch '4250-remove-legacy-runner-support-for-python-tests' into 'main'
remove support for running python system tests with legacy test runner

Closes #4250

See merge request isc-projects/bind9!8202
2023-09-19 15:09:08 +00:00
Tom Krizek
d050843a30 Update system test runner doc with pytest glue files
Document that pytest requires a glue file for each shell tests in order
to detect it.
2023-09-19 15:45:53 +02:00
Tom Krizek
363677bde7 Add CHANGES note for [GL #4250] 2023-09-19 15:45:49 +02:00
Tom Krizek
8deb026748 Use integers for ports fixtures in pytest
Reorganize individual port fixtures and re-use the ports fixture to
obtain their number. Store it as integer and only cast it to string when
setting it as environment variable.
2023-09-19 15:43:33 +02:00
Tom Krizek
197dac55a2 Reformat conftest.py with black 2023-09-19 15:43:33 +02:00
Tom Krizek
d16e5fd5e5 Remove legacy runner support from conftest.py
Remove code fork for legacy runner, reorganize imports and move a
pylint-silencing snippet to the top of the file. The rest of the code
was just unindented.
2023-09-19 15:43:33 +02:00