Commit Graph
39989 Commits
Author SHA1 Message Date
Mark Andrews d97dc03b8e Detect duplicate use of control sockets in named.conf
Specifying duplicate control sockets can lead to hard to diagnose
rndc connection failures.
2023-10-05 11:32:01 +11:00
Petr Špaček a2c771d994 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
2023-10-04 12:51:02 +00:00
Petr Špaček f2a3eb00b9 Generate and capture JUnit XML output from cross-version-config-tests 2023-10-04 14:50:25 +02:00
Petr Špaček bfc6b43319 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
2023-10-03 12:36:41 +00:00
Petr Špaček 6451462a93 Fix no-case-compress description in the ARM
We confused ourselves, it seems.
2023-10-03 14:35:49 +02:00
Arаm Sаrgsyаn 23b52fb6a0 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
2023-09-28 14:49:28 +00:00
Aram Sargsyan b970556f21 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.
2023-09-28 13:43:18 +00:00
Arаm Sаrgsyаn 5a9ca612ee 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
2023-09-28 09:32:04 +00:00
Aram Sargsyan 9c545c3513 Add a CHANGES note for [GL #4331] 2023-09-28 08:14:31 +00:00
Aram Sargsyan fb7bbbd1be 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.
2023-09-28 08:14:05 +00:00
Evan Hunt 98cbf4ebfc Merge branch 'each-qp-extensions' into 'main'
extensions to QP trie to support DNS databases

See merge request isc-projects/bind9!8338
2023-09-28 07:41:51 +00:00
Evan Hunt 9736497d8a CHANGES for [GL !8338] 2023-09-28 00:32:47 -07:00
Evan Hunt 03016902dd 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.)
2023-09-28 00:32:44 -07:00
Evan Hunt 6231fd66af 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
2023-09-28 00:32:39 -07:00
Evan Hunt 4e3e61806c 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.
2023-09-28 00:32:37 -07:00
Evan Hunt 606232b8d5 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).
2023-09-28 00:30:57 -07:00
Evan Hunt 3bf23fadb0 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.
2023-09-28 00:30:51 -07:00
Evan Hunt 7f0242b8c7 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.
2023-09-28 00:30:47 -07:00
Evan Hunt 7f766ba7c4 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().
2023-09-28 00:30:43 -07:00
Evan Hunt 29cf7dceb7 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.
2023-09-28 07:01:13 +00:00
Evan Hunt 06ac957c4f Merge branch 'each-qp-benchmark' into 'main'
add a QP lookups benchmark

See merge request isc-projects/bind9!8345
2023-09-28 07:00:10 +00:00
Evan Hunt e68a691904 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.
2023-09-27 16:24:04 -07:00
Evan Hunt d71ebd2086 minor cleanups
- removed some commented-out code
- cleaned up uses of pval and ival that were not needed
2023-09-27 13:05:05 -07:00
Evan Hunt 5259648b3f Merge branch '4338-fix-qpmulti-benchmark' into 'main'
fix the qpmulti benchmark

Closes #4338

See merge request isc-projects/bind9!8344
2023-09-27 19:35:20 +00:00
Evan Hunt 232f90f005 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.
2023-09-27 11:51:03 -07:00
Arаm Sаrgsyаn f55488aa09 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
2023-09-27 11:19:51 +00:00
Aram Sargsyan f9bcabff24 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.
2023-09-27 10:03:40 +00:00
Aram Sargsyan f1f863dd81 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.
2023-09-27 10:03:40 +00:00
Ondřej Surý 2a2eba74fc Merge branch 'ondrej/workaround-free_pools' into 'main'
Workaround compiler bug that optimizes setting .free_pools

See merge request isc-projects/bind9!8339
2023-09-26 13:11:44 +00:00
Ondřej Surý ca912775a5 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.
2023-09-26 14:59:39 +02:00
Arаm Sаrgsyаn f494b21ce0 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
2023-09-26 12:57:33 +00:00
Aram Sargsyan 903a79f6ce 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.
2023-09-26 12:23:10 +00:00
Aram Sargsyan ed2f06ea4d 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.
2023-09-26 12:23:10 +00:00
Aram Sargsyan 5067b83116 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.
2023-09-26 12:23:10 +00:00
Mark Andrews 0d85492f6b 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
2023-09-26 03:13:57 +00:00
Mark Andrews e33dbd0cbd Document that reloading happens asynchronously 2023-09-26 02:43:51 +00:00
Mark Andrews 5b3238aa85 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.
2023-09-26 02:43:51 +00:00
Mark Andrews 9ca06af4b9 Merge branch 'marka-placeholder' into 'main'
Add placeholder entry for [GL #4336]

See merge request isc-projects/bind9!8335
2023-09-26 00:48:33 +00:00
Mark Andrews 7084313b53 Add placeholder entry for [GL #4336] 2023-09-26 10:22:10 +10:00
Ondřej Surý 65c92d001c 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
2023-09-25 05:41:53 +00:00
Ondřej Surý 15cae8d473 Add CHANGES note for [GL #4325] 2023-09-24 18:07:40 +02:00
Ondřej Surý f5af981831 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.
2023-09-24 18:07:40 +02:00
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