]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
2 years agoRemove dns_adblameinfo from dns_adb
Ondřej Surý [Thu, 21 Sep 2023 13:20:58 +0000 (15:20 +0200)] 
Remove dns_adblameinfo from dns_adb

Keeping the information about lame server in the ADB was done in !322 to
fix following security issue:

    [CVE-2021-25219] Disable "lame-ttl" cache

The handling of the lame servers needs to be redesigned and it is not
going to be enabled any time soon, and the current code is just dead
code that takes up space, code and stands in the way of making ADB work
faster.

Remove all the internals needed for handling the lame servers in the ADB
for now.  It might get reintroduced later if and when we redesign ADB.

2 years agoMerge branch '4354-statschannel-test-opesbsd' into 'main'
Arаm Sаrgsyаn [Thu, 12 Oct 2023 09:37:11 +0000 (09:37 +0000)] 
Merge branch '4354-statschannel-test-opesbsd' into 'main'

Resolve "Checking zone transfer information in the statistics channel fails on OpenBSD"

Closes #4354

See merge request isc-projects/bind9!8367

2 years agoMake the statschannel system test portable
Aram Sargsyan [Tue, 10 Oct 2023 10:41:07 +0000 (10:41 +0000)] 
Make the statschannel system test portable

The usage of the newline in the replacement part of the 'sed' call
works in GNU systems, but not in OpenBSD. Use 'awk' instead.

Also use the extended syntax of regular expressions for 'grep', which
is similarly more portable across the supported systems.

2 years agoMerge branch 'matthijs-fix-build-usdt' into 'main'
Matthijs Mekking [Tue, 10 Oct 2023 15:43:59 +0000 (15:43 +0000)] 
Merge branch 'matthijs-fix-build-usdt' into 'main'

Fix build error related to USDT

See merge request isc-projects/bind9!8368

2 years agoFix build error related to USDT
Matthijs Mekking [Tue, 10 Oct 2023 12:18:07 +0000 (14:18 +0200)] 
Fix build error related to USDT

The trace.h file is listed twice in the Makefile. This incidentally
caused an error where the build refused to replace an earlier placed
trace.h file.

2 years agoMerge branch 'each-qp-rpz' into 'main'
Evan Hunt [Tue, 10 Oct 2023 06:56:21 +0000 (06:56 +0000)] 
Merge branch 'each-qp-rpz' into 'main'

convert the RPZ summary database to to use a QP trie

See merge request isc-projects/bind9!8352

2 years agoCHANGES for [GL !8352]
Evan Hunt [Sat, 30 Sep 2023 09:08:35 +0000 (02:08 -0700)] 
CHANGES for [GL !8352]

2 years agoreduce search_lock coverage
Evan Hunt [Sat, 30 Sep 2023 20:23:51 +0000 (13:23 -0700)] 
reduce search_lock coverage

now that we're using qpmulti for the summary database, we
no longer need to hold search_lock for it. we do still need
it for the radix tree and the trigger counts.

2 years agoconvert the RPZ summary database to to use a QP trie
Evan Hunt [Sat, 30 Sep 2023 04:40:29 +0000 (21:40 -0700)] 
convert the RPZ summary database to to use a QP trie

now that we have the QP chain mechanism, we can convert the
RPZ summary database to use a QP trie instead of an RBT.

also revised comments throughout the file accordingly, and
incidentally cleaned up calls to new_node(), which can no
longer fail.

2 years agofix build bug with DNS_RPZ_TRACE
Evan Hunt [Fri, 29 Sep 2023 23:16:49 +0000 (16:16 -0700)] 
fix build bug with DNS_RPZ_TRACE

nonstardard naming of ref/unref and attach/detach functions caused
build errors when using DNS_RPZ_TRACE; this has been fixed.

2 years agofix a QP chain bug
Evan Hunt [Sat, 30 Sep 2023 05:31:17 +0000 (22:31 -0700)] 
fix a QP chain bug

depending on how the QP trie is traversed during a lookup, it is
possible for a search to terminate on a leaf which is a partial
match, without that leaf being added to the chain. to ensure the
chain is correct in this case, when a partial match condition is
detected via qpkey_compare(), we will call add_link() again, just
in case.  (add_link() will check for a duplicated node, so it will
be harmless if it was already done.)

2 years agoMerge branch 'ondrej/fix-load_names-benchmark' into 'main'
Ondřej Surý [Mon, 9 Oct 2023 19:09:25 +0000 (19:09 +0000)] 
Merge branch 'ondrej/fix-load_names-benchmark' into 'main'

Use read number of items instead of raw array size in load_names

See merge request isc-projects/bind9!8361

2 years agoAdd base testing set of names for load-names benchmark
Ondřej Surý [Fri, 6 Oct 2023 08:30:21 +0000 (10:30 +0200)] 
Add base testing set of names for load-names benchmark

This was generated from dnsperf queryfile with following script:

    #!/usr/bin/env python3
    names = {}

    import sys

    i = 0
    for line in iter(sys.stdin.readline, ''):
name = line.rstrip('\n')
if not name in names:
    names[name] = line
    print(f"{i},{name}")
    i += 1
if i >= 1024*1024:
    break

2 years agoFix hashmap part of load-names benchmark
Ondřej Surý [Fri, 6 Oct 2023 08:28:32 +0000 (10:28 +0200)] 
Fix hashmap part of load-names benchmark

The name_match() was errorneously converting struct item into dns_name
pointer.  Correctly retype void *node to struct item * first and then
use item.fixed.name to pass the name to dns_name_equal() function.

2 years agoUse read number of items instead of raw array size in load_names
Ondřej Surý [Fri, 6 Oct 2023 08:06:36 +0000 (10:06 +0200)] 
Use read number of items instead of raw array size in load_names

The load_names benchmark expected the input CSV with domains would fill
the whole item array and it would crash when the number of lines would
be less than that.

Fix the expectations by using the real number or lines read to calculate
the array start and end position for each benchmark thread.

2 years agoMerge branch 'michal/move-linux-stress-tests-to-autoscaled-instances' into 'main'
Michał Kępień [Fri, 6 Oct 2023 11:09:41 +0000 (11:09 +0000)] 
Merge branch 'michal/move-linux-stress-tests-to-autoscaled-instances' into 'main'

Move Linux "stress" tests to autoscaled instances

See merge request isc-projects/bind9!8359

2 years agoMove Linux "stress" tests to autoscaled instances
Michał Kępień [Fri, 6 Oct 2023 11:07:55 +0000 (13:07 +0200)] 
Move Linux "stress" tests to autoscaled instances

The autoscaling GitLab CI runners currently used for most GitLab CI jobs
spin up AWS EC2 instances that are at least as powerful as the dedicated
instances used for running "stress" tests.  Move all Linux-based
"stress" tests to autoscaling GitLab CI runners to enable deprovisioning
Linux AWS instances reserved for running "stress" tests.  Leave FreeBSD
"stress" tests intact as there is currently no support for autoscaling
BSD instances.

2 years agoMerge branch 'mnowak/monitor-stuck-system-tests' into 'main'
Michal Nowak [Thu, 5 Oct 2023 16:24:37 +0000 (16:24 +0000)] 
Merge branch 'mnowak/monitor-stuck-system-tests' into 'main'

Report hung system tests

See merge request isc-projects/bind9!8245

2 years agoReport hung system tests
Michal Nowak [Wed, 16 Aug 2023 14:19:30 +0000 (16:19 +0200)] 
Report hung system tests

At times, a problem might occur where a test is not responding,
especially in the CI, determining the specific test responsible can be
difficult. Fortunately, when running tests with the pytest runner,
pytest sets the PYTEST_CURRENT_TEST environment variable to the current
test nodeid and stage. Afterward, the variable can be examined to
identify the test that has stopped responding.

The monitoring script needs to be started in the background. Still, the
shell executor used for BSD and FIPS testing can't handle the background
process cleanly, and the script step will wait for the background
process for the entire duration of the background process (currently
3000 seconds). Therefore, run the monitoring script only when the Docker
executor is used where this is not a problem.

2 years agoMerge branch '4253-detect-duplicate-controls' into 'main'
Mark Andrews [Thu, 5 Oct 2023 01:32:40 +0000 (01:32 +0000)] 
Merge branch '4253-detect-duplicate-controls' into 'main'

Detect duplicate "controls" configuration

Closes #4253

See merge request isc-projects/bind9!8313

2 years agoAdd CHANGES note for [GL #4253]
Mark Andrews [Wed, 20 Sep 2023 03:03:10 +0000 (13:03 +1000)] 
Add CHANGES note for [GL #4253]

2 years agoCheck that duplicate control sockets are caught
Mark Andrews [Wed, 20 Sep 2023 02:58:14 +0000 (12:58 +1000)] 
Check that duplicate control sockets are caught

2 years agoDetect duplicate use of control sockets in named.conf
Mark Andrews [Wed, 20 Sep 2023 02:53:35 +0000 (12:53 +1000)] 
Detect duplicate use of control sockets in named.conf

Specifying duplicate control sockets can lead to hard to diagnose
rndc connection failures.

2 years agoMerge branch 'pspacek/cross-version-tests-junit' into 'main'
Petr Špaček [Wed, 4 Oct 2023 12:51:02 +0000 (12:51 +0000)] 
Merge branch 'pspacek/cross-version-tests-junit' into 'main'

Generate and capture JUnit XML output from cross-version-config-tests

See merge request isc-projects/bind9!8354

2 years agoGenerate and capture JUnit XML output from cross-version-config-tests
Petr Špaček [Tue, 3 Oct 2023 09:15:39 +0000 (11:15 +0200)] 
Generate and capture JUnit XML output from cross-version-config-tests

2 years agoMerge branch 'pspacek/fix-no-case-compression-docs' into 'main'
Petr Špaček [Tue, 3 Oct 2023 12:36:41 +0000 (12:36 +0000)] 
Merge branch 'pspacek/fix-no-case-compression-docs' into 'main'

Fix no-case-compress description in the ARM

See merge request isc-projects/bind9!8312

2 years agoFix no-case-compress description in the ARM
Petr Špaček [Tue, 19 Sep 2023 14:31:58 +0000 (16:31 +0200)] 
Fix no-case-compress description in the ARM

We confused ourselves, it seems.

2 years agoMerge branch '4343-cid-465861-unnecessary-null-check-in-ns__client_setup' into 'main'
Arаm Sаrgsyаn [Thu, 28 Sep 2023 14:49:28 +0000 (14:49 +0000)] 
Merge branch '4343-cid-465861-unnecessary-null-check-in-ns__client_setup' into 'main'

Remove unnecessary NULL-checks in ns__client_setup()

Closes #4343

See merge request isc-projects/bind9!8347

2 years agoRemove unnecessary NULL-checks in ns__client_setup()
Aram Sargsyan [Thu, 28 Sep 2023 13:43:18 +0000 (13:43 +0000)] 
Remove unnecessary NULL-checks in ns__client_setup()

All these pointers are guaranteed to be non-NULL.

Additionally, update a comment to remove obviously outdated
information about the function's requirements.

2 years agoMerge branch '4331-resolver.c-assert-uninitialized-link' into 'main'
Arаm Sаrgsyаn [Thu, 28 Sep 2023 09:32:04 +0000 (09:32 +0000)] 
Merge branch '4331-resolver.c-assert-uninitialized-link' into 'main'

Don't use an uninitialized link on an error path

Closes #4331

See merge request isc-projects/bind9!8343

2 years agoAdd a CHANGES note for [GL #4331]
Aram Sargsyan [Wed, 27 Sep 2023 11:34:30 +0000 (11:34 +0000)] 
Add a CHANGES note for [GL #4331]

2 years agoDon't use an uninitialized link on an error path
Aram Sargsyan [Wed, 27 Sep 2023 11:22:43 +0000 (11:22 +0000)] 
Don't use an uninitialized link on an error path

Move the block on the error path, where the link is checked, to a place
where it makes sense, to avoid accessing an unitialized link when
jumping to the 'cleanup_query' label from 4 different places. The link
is initialized only after those jumps happen.

In addition, initilize the link when creating the object, to avoid
similar errors.

2 years agoMerge branch 'each-qp-extensions' into 'main'
Evan Hunt [Thu, 28 Sep 2023 07:41:51 +0000 (07:41 +0000)] 
Merge branch 'each-qp-extensions' into 'main'

extensions to QP trie to support DNS databases

See merge request isc-projects/bind9!8338

2 years agoCHANGES for [GL !8338]
Evan Hunt [Wed, 27 Sep 2023 03:23:13 +0000 (20:23 -0700)] 
CHANGES for [GL !8338]

2 years agorename dns_qp_findname_ancestor() to dns_qp_lookup()
Evan Hunt [Wed, 27 Sep 2023 03:19:37 +0000 (20:19 -0700)] 
rename dns_qp_findname_ancestor() to dns_qp_lookup()

I am weary of typing so long a name. (plus, the name has become slightly
misleading now that the DNS_QPFIND_NOEXACT option no longer exists.)

2 years agorename QP-related types to use standard BIND nomenclature
Evan Hunt [Tue, 26 Sep 2023 20:38:12 +0000 (13:38 -0700)] 
rename QP-related types to use standard BIND nomenclature

changed type names in QP trie code to match the usual convention:
 - qp_node_t -> dns_qpnode_t
 - qp_ref_t -> dns_qpref_t
 - qp_shift_t -> dns_qpshift_t
 - qp_weight_t -> dns_qpweight_t
 - qp_chunk_t -> dns_qpchunk_t
 - qp_cell_t -> dns_qpcell_t

2 years agoget predecessor name in dns_qp_findname_ancestor()
Evan Hunt [Sat, 23 Sep 2023 22:58:46 +0000 (15:58 -0700)] 
get predecessor name in dns_qp_findname_ancestor()

dns_qp_findname_ancestor() now takes an optional 'predecessor'
parameter, which if non-NULL is updated to contain the DNSSEC
predecessor of the name searched for. this is done by constructing
an iterator stack while carrying out the search, so it can be used
to step backward if needed.

2 years agoremove DNS_QPFIND_NOEXACT
Evan Hunt [Sat, 23 Sep 2023 08:02:17 +0000 (01:02 -0700)] 
remove DNS_QPFIND_NOEXACT

since dns_qp_findname_ancestor() can now return a chain object, it is no
longer necessary to provide a _NOEXACT search option. if we want to look
up the closest ancestor of a name, we can just do a normal search, and
if successful, retrieve the second-to-last node from the QP chain.

this makes ancestor lookups slightly more complicated for the caller,
but allows us to simplify the code in dns_qp_findname_ancestor(), making
it easier to ensure correctness.  this was a fairly rare use case:
outside of unit tests, DNS_QPFIND_NOEXACT was only used in the zone
table, which has now been updated to use the QP chain.  the equivalent
RBT feature is only used by the resolver for cache lookups of 'atparent'
types (i.e, DS records).

2 years agoimprovements to the QP iterator
Evan Hunt [Tue, 19 Sep 2023 07:41:57 +0000 (00:41 -0700)] 
improvements to the QP iterator

- make iterators reversible: refactor dns_qpiter_next() and add a new
  dns_qpiter_prev() function to support iterating both forwards and
  backwards through a QP trie.
- added a 'name' parameter to dns_qpiter_next() (as well as _prev())
  to make it easier to retrieve the nodename while iterating, without
  having to construct it from pointer value data.

2 years agotidy the helper functions for retrieving twigs
Evan Hunt [Wed, 27 Sep 2023 16:08:37 +0000 (09:08 -0700)] 
tidy the helper functions for retrieving twigs

- the helper functions for accessing twigs beneath a branch
  (branch_twig_pos(), branch_twig_ptr(), etc) were somewhat confusing
  to read, since several of them were implemented by calling other
  helper functions. they now all show what they're really doing.
- branch_twigs_vector() has been renamed to simply branch_twigs().
- revised some unrelated comments in qp_p.h for clarity.

2 years agoadd a node chain traversal mechanism
Evan Hunt [Sat, 9 Sep 2023 00:44:53 +0000 (17:44 -0700)] 
add a node chain traversal mechanism

dns_qp_findname_ancestor() now takes an optional 'chain' parameter;
if set, the dns_qpchain object it points to will be updated with an
array of pointers to the populated nodes between the tree root and the
requested name. the number of nodes in the chain can then be accessed
using dns_qpchain_length() and the individual nodes using
dns_qpchain_node().

2 years agomodify dns_qp_findname_ancestor() to return found name
Evan Hunt [Thu, 7 Sep 2023 06:57:42 +0000 (23:57 -0700)] 
modify dns_qp_findname_ancestor() to return found name

add a 'foundname' parameter to dns_qp_findname_ancestor(),
and use it to set the found name in dns_nametree.

this required adding a dns_qpkey_toname() function; that was
done by moving qp_test_keytoname() from the test library to qp.c.
added some more test cases and fixed bugs with the handling of
relative and empty names.

2 years agoMerge branch 'each-qp-benchmark' into 'main'
Evan Hunt [Thu, 28 Sep 2023 07:00:10 +0000 (07:00 +0000)] 
Merge branch 'each-qp-benchmark' into 'main'

add a QP lookups benchmark

See merge request isc-projects/bind9!8345

2 years agoadd a "qplookups" benchmark test
Evan Hunt [Wed, 27 Sep 2023 22:37:30 +0000 (15:37 -0700)] 
add a "qplookups" benchmark test

this loads a file containing DNS names and measures the time it takes to:
1) iterate it,
2) look up each name with dns_qp_getname()
3) look up each name with dns_qp_findname_ancestor()
4) look up a modified name based on the name, to check performance
   when the name is not found.

2 years agominor cleanups
Evan Hunt [Wed, 27 Sep 2023 20:01:43 +0000 (13:01 -0700)] 
minor cleanups

- removed some commented-out code
- cleaned up uses of pval and ival that were not needed

2 years agoMerge branch '4338-fix-qpmulti-benchmark' into 'main'
Evan Hunt [Wed, 27 Sep 2023 19:35:20 +0000 (19:35 +0000)] 
Merge branch '4338-fix-qpmulti-benchmark' into 'main'

fix the qpmulti benchmark

Closes #4338

See merge request isc-projects/bind9!8344

2 years agofixed the qpmulti benchmark
Evan Hunt [Wed, 27 Sep 2023 18:49:21 +0000 (11:49 -0700)] 
fixed the qpmulti benchmark

the refactoring of isc_job_run() and isc_async_run() in 9.19.12
intefered with the way the qpmulti benchmark uses uv_idle.
it has now been modified to use isc_job/isc_async instead.

2 years agoMerge branch '4335-xfrin_xmlrender-cleanup-path-issue' into 'main'
Arаm Sаrgsyаn [Wed, 27 Sep 2023 11:19:51 +0000 (11:19 +0000)] 
Merge branch '4335-xfrin_xmlrender-cleanup-path-issue' into 'main'

Resolve "CID 465814: Control flow issues (DEADCODE) in statschannel.c"

Closes #4335

See merge request isc-projects/bind9!8334

2 years agoFix return value and docs for dns_zone_getxfr()
Aram Sargsyan [Mon, 25 Sep 2023 12:33:29 +0000 (12:33 +0000)] 
Fix return value and docs for dns_zone_getxfr()

When the given zone is not associated with a zone manager, the function
currently returns ISC_R_NOTFOUND, which is documented as the return
value for the case in which no incoming zone transfer is found.  Make
the function return ISC_R_FAILURE in such a case instead.

Also update the description of the function as the value it returns is
not meant to indicate whether an ongoing incoming transfer for the given
zone exists.  The boolean variables that the function sets via the
pointers provided as its parameters, combined with either keeping
'*xfrp' set to NULL or updating it to a valid pointer, can be used by
the caller to infer all the necessary information.

2 years agoFix error path issue in xfrin_xmlrender()
Aram Sargsyan [Mon, 25 Sep 2023 09:38:03 +0000 (09:38 +0000)] 
Fix error path issue in xfrin_xmlrender()

The TRY0 macro doesn't set the 'result' variable, so the error
log message is never printed. Remove the 'result' variable and
modify the function's control flow to be similar to the the
zone_xmlrender() function, with a separate error returning path.

2 years agoMerge branch 'ondrej/workaround-free_pools' into 'main'
Ondřej Surý [Tue, 26 Sep 2023 13:11:44 +0000 (13:11 +0000)] 
Merge branch 'ondrej/workaround-free_pools' into 'main'

Workaround compiler bug that optimizes setting .free_pools

See merge request isc-projects/bind9!8339

2 years agoWorkaround compiler bug that optimizes setting .free_pools
Ondřej Surý [Tue, 26 Sep 2023 12:29:54 +0000 (14:29 +0200)] 
Workaround compiler bug that optimizes setting .free_pools

The .free_pools bitfield would not be set on some levels of
optimizations - workaround the compiler bug by reordering the setting
the .freepools in the initializer.

2 years agoMerge branch '4332-data-race-in-dns_xfrin_getendserial' into 'main'
Arаm Sаrgsyаn [Tue, 26 Sep 2023 12:57:33 +0000 (12:57 +0000)] 
Merge branch '4332-data-race-in-dns_xfrin_getendserial' into 'main'

xfrin.c: use the statslock for more xfrin members

Closes #4332

See merge request isc-projects/bind9!8333

2 years agoDon't use the statslock in the destructor
Aram Sargsyan [Fri, 22 Sep 2023 16:01:08 +0000 (16:01 +0000)] 
Don't use the statslock in the destructor

Using the 'statslock' mutex in the destructor is useless, because
at this point there shouldn't be any other references to the
structure.

2 years agoRemove xfr->end
Aram Sargsyan [Fri, 22 Sep 2023 15:59:32 +0000 (15:59 +0000)] 
Remove xfr->end

The structure member is populated only moments before its
destruction, and is not used anywhere, except for the
destructor. Use a local variable instead.

2 years agoUse the statslock for more xfrin members
Aram Sargsyan [Fri, 22 Sep 2023 15:38:14 +0000 (15:38 +0000)] 
Use the statslock for more xfrin members

The 'end_serial' and some other members of the 'dns_xfrin_t'
structure can be accessed by the statistics channel, causing
a data race with the zone transfer process.

Use the existing 'statslock' mutex for protecting those members.

2 years agoMerge branch '4316-dynamic-update-refused-shortly-after-zone-was-thawed' into 'main'
Mark Andrews [Tue, 26 Sep 2023 03:13:57 +0000 (03:13 +0000)] 
Merge branch '4316-dynamic-update-refused-shortly-after-zone-was-thawed' into 'main'

Resolve "dynamic update refused shortly after zone was thawed"

Closes #4316

See merge request isc-projects/bind9!8310

2 years agoDocument that reloading happens asynchronously
Mark Andrews [Wed, 20 Sep 2023 05:49:59 +0000 (15:49 +1000)] 
Document that reloading happens asynchronously

2 years agoWait for the test zone to finish re-loading
Mark Andrews [Tue, 19 Sep 2023 04:06:15 +0000 (14:06 +1000)] 
Wait for the test zone to finish re-loading

'rndc thaw' initiates asynchrous loading of all the zones
similar to 'rndc load'.  Wait for the test zone's load to
complete before testing that it is updatable again.

2 years agoMerge branch 'marka-placeholder' into 'main'
Mark Andrews [Tue, 26 Sep 2023 00:48:33 +0000 (00:48 +0000)] 
Merge branch 'marka-placeholder' into 'main'

Add placeholder entry for [GL #4336]

See merge request isc-projects/bind9!8335

2 years agoAdd placeholder entry for [GL #4336]
Mark Andrews [Tue, 26 Sep 2023 00:21:46 +0000 (10:21 +1000)] 
Add placeholder entry for [GL #4336]

2 years agoMerge branch '4325-reduce-isc_mempool-contention' into 'main'
Ondřej Surý [Mon, 25 Sep 2023 05:41:53 +0000 (05:41 +0000)] 
Merge branch '4325-reduce-isc_mempool-contention' into 'main'

Change dns_message_create() function to accept memory pools

Closes #4325

See merge request isc-projects/bind9!8330

2 years agoAdd CHANGES note for [GL #4325]
Ondřej Surý [Wed, 20 Sep 2023 07:46:02 +0000 (09:46 +0200)] 
Add CHANGES note for [GL #4325]

2 years agoChange dns_message_create() function to accept memory pools
Ondřej Surý [Fri, 22 Sep 2023 13:00:40 +0000 (15:00 +0200)] 
Change dns_message_create() function to accept memory pools

Instead of creating new memory pools for each new dns_message, change
dns_message_create() method to optionally accept externally created
dns_fixedname_t and dns_rdataset_t memory pools.  This allows us to
preallocate the memory pools in ns_client and dns_resolver units for the
lifetime of dns_resolver_t and ns_clientmgr_t.

2 years agoConvert dns_message reference counting to ISC_REFCOUNT macros
Ondřej Surý [Fri, 22 Sep 2023 11:59:10 +0000 (13:59 +0200)] 
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.

2 years agoImprove isc_refcount with initializer and implicit destroy
Ondřej Surý [Fri, 22 Sep 2023 11:57:26 +0000 (13:57 +0200)] 
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.

2 years agoMerge branch 'aram/statschannel-expose-precursory-soa-request-state' into 'main'
Arаm Sаrgsyаn [Fri, 22 Sep 2023 12:40:53 +0000 (12:40 +0000)] 
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

2 years agoAdd a CHANGES note for [GL !8305]
Aram Sargsyan [Fri, 15 Sep 2023 11:02:09 +0000 (11:02 +0000)] 
Add a CHANGES note for [GL !8305]

2 years agoFix the incoming transfers' "Needs Refresh" state in stats channel
Aram Sargsyan [Tue, 19 Sep 2023 09:38:35 +0000 (09:38 +0000)] 
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.

2 years agoxfrin: rename XFRST_INITIALSOA to XFRST_ZONEXFRREQUEST
Aram Sargsyan [Tue, 19 Sep 2023 09:35:20 +0000 (09:35 +0000)] 
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.

2 years agoShow the local and remote addresses for the "Refresh SOA" query
Aram Sargsyan [Fri, 15 Sep 2023 10:47:17 +0000 (10:47 +0000)] 
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".

2 years agoImprove the "Duration (s)" field of the incoming xfers in stats channel
Aram Sargsyan [Fri, 15 Sep 2023 10:03:29 +0000 (10:03 +0000)] 
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.

2 years agoAdd the "Refresh SOA" state for the incoming zone transfers
Aram Sargsyan [Fri, 15 Sep 2023 08:57:21 +0000 (08:57 +0000)] 
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.

2 years agoMerge branch 'aram/statschannel-expose-xfrin-soa-transport' into 'main'
Arаm Sаrgsyаn [Fri, 22 Sep 2023 10:59:30 +0000 (10:59 +0000)] 
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

2 years agoCheck zone transfer transports in the statistics channel
Aram Sargsyan [Wed, 13 Sep 2023 13:17:38 +0000 (13:17 +0000)] 
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).

2 years agoAdd a CHANGES note for [GL !8240]
Aram Sargsyan [Wed, 23 Aug 2023 11:42:57 +0000 (11:42 +0000)] 
Add a CHANGES note for [GL !8240]

2 years agoExpose the SOA query transport type used before/during XFR
Aram Sargsyan [Wed, 23 Aug 2023 10:46:44 +0000 (10:46 +0000)] 
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.

2 years agoMerge branch '3883-expose-data-about-transfers-in-progress' into 'main'
Arаm Sаrgsyаn [Fri, 22 Sep 2023 09:40:23 +0000 (09:40 +0000)] 
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

2 years agoWait for slow zone transfer to complete before ending test
Mark Andrews [Fri, 11 Aug 2023 03:28:05 +0000 (13:28 +1000)] 
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.

2 years agoProvide thread safe access to dns_xfrin_t state
Mark Andrews [Thu, 6 Jul 2023 04:00:48 +0000 (14:00 +1000)] 
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.

2 years agoAdd CHANGES and release notes for [GL #3883]
Aram Sargsyan [Tue, 30 May 2023 15:11:24 +0000 (15:11 +0000)] 
Add CHANGES and release notes for [GL #3883]

2 years agoDocument zone transfers in statschannel
Aram Sargsyan [Mon, 3 Jul 2023 14:04:54 +0000 (14:04 +0000)] 
Document zone transfers in statschannel

List the JSON and XML URLs in ARM for retrieving the incoming zone
transfers information from the statistics channel.

2 years agoAdd a test case for checking zone transfers in statschannel
Aram Sargsyan [Tue, 30 May 2023 15:00:33 +0000 (15:00 +0000)] 
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.

2 years agoImplement exposing data about zone transfers in progress
Aram Sargsyan [Tue, 30 May 2023 14:58:29 +0000 (14:58 +0000)] 
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.

2 years agoImplement various dns_xfrin_get*() functions
Aram Sargsyan [Tue, 30 May 2023 14:56:32 +0000 (14:56 +0000)] 
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.

2 years agoImplement dns_zone_getxfr()
Aram Sargsyan [Tue, 30 May 2023 14:39:02 +0000 (14:39 +0000)] 
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.

2 years agodns_transport: use const arguments in getters when possible
Aram Sargsyan [Tue, 30 May 2023 14:32:02 +0000 (14:32 +0000)] 
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.

2 years agoMerge branch '4327-minor-warning-about-ctype-h-function' into 'main'
Ondřej Surý [Fri, 22 Sep 2023 06:30:06 +0000 (06:30 +0000)] 
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

2 years agoAdd CHANGES note for [GL #4327]
Ondřej Surý [Wed, 20 Sep 2023 15:42:28 +0000 (17:42 +0200)] 
Add CHANGES note for [GL #4327]

2 years agoExplicitly cast chars to unsigned chars for <ctype.h> functions
Ondřej Surý [Wed, 20 Sep 2023 15:23:28 +0000 (17:23 +0200)] 
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()).

2 years agoAdd semantic patch to explicitly cast chars to unsigned for ctype.h
Ondřej Surý [Wed, 20 Sep 2023 15:23:28 +0000 (17:23 +0200)] 
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.

2 years agoMerge branch 'mnowak/add-cve-ref-role' into 'main'
Michał Kępień [Thu, 21 Sep 2023 12:22:49 +0000 (12:22 +0000)] 
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

2 years agoAdd a Sphinx role for linking CVEs to the ISC Knowledgebase
Michal Nowak [Thu, 31 Aug 2023 16:55:36 +0000 (18:55 +0200)] 
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.

2 years agoMerge branch 'michal/update-sphinx-and-sphinx_rtd_theme' into 'main'
Michał Kępień [Wed, 20 Sep 2023 15:20:25 +0000 (15:20 +0000)] 
Merge branch 'michal/update-sphinx-and-sphinx_rtd_theme' into 'main'

Update Sphinx and sphinx_rtd_theme

See merge request isc-projects/bind9!8322

2 years agoUpdate Sphinx and sphinx_rtd_theme
Michał Kępień [Wed, 20 Sep 2023 15:18:24 +0000 (17:18 +0200)] 
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.

2 years agoMerge tag 'v9.19.17'
Michał Kępień [Wed, 20 Sep 2023 14:45:47 +0000 (16:45 +0200)] 
Merge tag 'v9.19.17'

2 years agoMerge branch 'ondrej/remove-isc_hash_function' into 'main'
Ondřej Surý [Tue, 19 Sep 2023 18:48:56 +0000 (18:48 +0000)] 
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

2 years agoUse the new isc_sockaddr_hash_ex() to fix QID table hashing
Ondřej Surý [Mon, 18 Sep 2023 08:02:37 +0000 (10:02 +0200)] 
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.

2 years agoAdd isc_sockaddr_hash_ex that can be used in incremental hashing
Ondřej Surý [Mon, 18 Sep 2023 07:59:10 +0000 (09:59 +0200)] 
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.

2 years agoRemove isc_hash_function macro
Ondřej Surý [Tue, 12 Sep 2023 14:37:50 +0000 (16:37 +0200)] 
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.