Commit Graph
39255 Commits
Author SHA1 Message Date
Tom Krizek 2633732fb1 Merge branch 'tkrizek/remove-trailing-whitespace' into 'main'
Remove trailing whitespace from all text files

See merge request isc-projects/bind9!8012
2023-06-13 13:31:32 +00:00
Tom Krizek 034a32a4f3 Add utility script to detect trailing whitespace
Run the script in CI as well to ensure we don't accidentally add
trailing whitespace again.
2023-06-13 15:06:38 +02:00
Tom Krizek 03e981ed2c Ignore trailing whitespace removal commit in git blame 2023-06-13 15:06:38 +02:00
Tom Krizek 5893debf46 Remove trailing whitespace from all text files
I've used the following command to remove the trailing whitespace for
all tracked text files:

git grep -Il '' | xargs sed -i 's/[ \t]*$//'
2023-06-13 15:05:40 +02:00
Arаm Sаrgsyаn 589752fc69 Merge branch '4136-catz-db-update-notify-bug' into 'main'
Fix catz db update callback registration logic error

Closes #4136

See merge request isc-projects/bind9!8025
2023-06-13 13:01:05 +00:00
Aram Sargsyan 23f609ba59 Add a CHANGES note for [GL #4136] 2023-06-13 12:58:13 +00:00
Aram Sargsyan 998765fea5 Fix catz db update callback registration logic error
When a catalog zone is updated using AXFR, the zone database is changed,
so it is required to unregister the update notification callback from
the old database, and register it for the new one.

Currently, here is the order of the steps happening in such scenario:

1. The zone.c:zone_startload() function registers the notify callback
   on the new database using dns_zone_catz_enable_db()
2. The callback, when called, notices that the new 'db' is different
   than 'catz->db', and unregisters the old callback for 'catz->db',
   marks that it's unregistered by setting 'catz->db_registered' to
   false, then it schedules an update if it isn't already scheduled.
3. The offloaded update process, after completing its job, notices that
   'catz->db_registered' is false, and (re)registers the update callback
   for the current database it is working on. There is no harm here even
   if it was registered also on step 1, and we can't skip it, because
   this function can also be called "artificially" during a
   reconfiguration, and in that case the registration step is required
   here.

A problem arises when before step 1 an update process was already
in a running state, operating on the old database, and finishing its
work only after step 2. As described in step 3, dns__catz_update_cb()
notices that 'catz->db_registered' is false and registers the callback
on the current database it is working on, which, at that state, is
already obsolete and unused by the zone. When it detaches the database,
the function which is responsible for its cleanup (e.g. free_rbtdb())
asserts because there is a registered update notify callback there.

To fix the problem, instead of delaying the (re)registration to step 3,
make sure that the new callback is registered and 'catz->db_registered'
is accordingly marked on step 2.
2023-06-13 12:58:13 +00:00
Tom Krizek b94e500d3d Merge branch '4117-serve-stale-check' into 'main'
Avoid false positive in serve-stale system test check

Closes #4117

See merge request isc-projects/bind9!8026
2023-06-13 12:10:25 +00:00
Tom Krizek dd7bcd2855 Avoid false positive in serve-stale system test check
The purpose of the check is to verify the server has survived the
previous barrage of queries. This is done by sending a query and
checking we get a NOERROR response back.

Previously, that query could've been affected by a servfail cache - the
server would return a SERVFAIL answer, thus failing the check, despite
being up and running. Use version.bind txt ch query to avoid the
interference of servfail cache.
2023-06-13 10:52:01 +02:00
Michal Nowak c1879b54c3 Merge branch 'mnowak/set-up-version-and-release-notes-for-bind-9.19.15' into 'main'
Set up version and release notes for BIND 9.19.15

See merge request isc-projects/bind9!8021
2023-06-12 15:12:13 +00:00
Michal Nowak a04301f936 Set up release notes for BIND 9.19.15 2023-06-12 16:12:40 +02:00
Michal Nowak 8f6e77aee9 Update BIND version to 9.19.15-dev 2023-06-12 16:12:27 +02:00
Arаm Sаrgsyаn 282c5605b6 Merge branch '4105-QryDropped-stats-counter-documentation-update' into 'main'
QryDropped stats counter documentation update

Closes #4105

See merge request isc-projects/bind9!8006
2023-06-07 14:00:50 +00:00
Aram Sargsyan 27c30fe8a4 QryDropped stats counter documentation update
Document which dropped queries are calculated by the QryDropped
statistics counter.
2023-06-07 13:06:58 +00:00
Michal Nowak e15455f848 Merge branch 'mnowak/placeholder-for-issue-4055' into 'main'
Add CHANGES placeholder for [GL #4055]

See merge request isc-projects/bind9!8010
2023-06-07 11:42:58 +00:00
Michal Nowak 0856c08ae9 Add CHANGES placeholder for [GL #4055] 2023-06-07 13:39:12 +02:00
Michal Nowak 490b7bd352 Merge branch 'mnowak/placeholder-for-issue-4089' into 'main'
Add CHANGES placeholder for [GL #4089]

See merge request isc-projects/bind9!8009
2023-06-07 11:18:10 +00:00
Michal Nowak a2b3c2a386 Add CHANGES placeholder for [GL #4089] 2023-06-07 13:07:51 +02:00
Michal Nowak fd606a8ea8 Merge branch 'mnowak/placeholder-for-issue-3835' into 'main'
Add CHANGES placeholder for [GL #3835]

See merge request isc-projects/bind9!8008
2023-06-07 09:00:42 +00:00
Michal Nowak e6ed763bf3 Add CHANGES placeholder for [GL #3835] 2023-06-07 10:47:37 +02:00
Ondřej Surý 5bca79da1a Merge branch '4115-fix-extra-dns_validator-detach' into 'main'
Fix extra detach when dns_validator create_fetch() detects deadlock

Closes #4115

See merge request isc-projects/bind9!8003
2023-06-06 17:34:22 +00:00
Ondřej Surý 1d03cac78a Add CHANGES note for [GL #4115] 2023-06-06 19:04:17 +02:00
Ondřej Surý 696506e164 Fix extra detach when dns_validator create_fetch() detects deadlock
When create_fetch() in the dns_validator unit detects deadlock, it
returns DNS_R_NOVALIDSIG, but it didn't attach to the validator.  The
other condition to returning result != ISC_R_SUCCESS would be error from
dns_resolver_createfetch().  The caller (in two places out of three)
would detect the error condition and always detach from the validator.

Move the dns_validator_detach() on dns_resolver_createfetch() error
condition to create_fetch() function and cleanup the extra detaches in
seek_dnskey() and get_dsset().
2023-06-06 19:04:17 +02:00
Ondřej Surý fbab2dd45f Merge branch '4038-resize-send-buffers-to-avoid-excessive-memory-allocation' into 'main'
Use appropriately sized send buffers for DNS messages over TCP

Closes #4038

See merge request isc-projects/bind9!8004
2023-06-06 11:41:44 +00:00
Ondřej Surý dff9a56f07 Merge branch 'ondrej/print-library-versions' into 'main'
Print the libuv, liburcu and OpenSSL versions from configure script

See merge request isc-projects/bind9!7998
2023-06-06 11:40:51 +00:00
Artem BoldarievandOndřej Surý 8672d54847 Update CHANGES and release note [GL #4038]
Mention that memory usage was reduced by allocating properly sized
send buffers for stream-based transports.
2023-06-06 13:40:42 +02:00
Artem BoldarievandOndřej Surý d8a5feb556 Use appropriately sized send buffers for DNS messages over TCP
This commit changes send buffers allocation strategy for stream based
transports. Before that change we would allocate a dynamic buffers
sized at 64Kb even when we do not need that much. That could lead to
high memory usage on server. Now we resize the send buffer to match
the size of the actual data, freeing the memory at the end of the
buffer for being reused later.
2023-06-06 13:40:42 +02:00
Ondřej Surý 920dddb729 Print the libuv, liburcu and OpenSSL versions from configure script
The configure summary now prints versions of the mandatory libraries
found when configuring.
2023-06-06 12:42:02 +02:00
Mark Andrews 8169a0ee31 Merge branch '4116-building-with-with-liburcu-qsbr-fails' into 'main'
Resolve "Building with --with-liburcu=qsbr fails"

Closes #4116

See merge request isc-projects/bind9!8002
2023-06-05 23:46:49 +00:00
Mark Andrews e6e4ac05b8 Fix typo in synchronize_rcu macro (add h)
synchronize_rcu has not been used until now in BIND9 and there
was a typo in the define (a 'h' was missing).
2023-06-06 08:10:09 +10:00
Mark Andrews c26d66604b Merge branch '4093-use-rcu-for-view-zonetable' into 'main'
Use RCU for view->zonetable

Closes #4093

See merge request isc-projects/bind9!7990
2023-06-02 00:39:07 +00:00
Mark AndrewsandOndřej Surý 47ed397806 Add CHANGES note for [GL #4093] 2023-06-01 16:51:38 +02:00
Mark AndrewsandOndřej Surý 783c6a9538 Use dns_view_findzone instead of dns_zt_find
This ensures that rcu locking is properly applied for
view->zonetable.
2023-06-01 16:51:38 +02:00
Mark AndrewsandOndřej Surý 8d86fa7135 Extend dns_view_findzone to take an options argument
This is in preparation to allow the few remaining direct
dns_zt_find(view->zonetable, ...) to use it for rcu mediated
access to view->zonetable.
2023-06-01 16:51:38 +02:00
Mark AndrewsandOndřej Surý ceb3264082 Add dns_view_apply
Add dns_view_apply to allow dns_zt_apply to be called on
view->zonetable with rcu locking applied.
2023-06-01 16:51:38 +02:00
Mark AndrewsandOndřej Surý e0f41259bd Add dns_view_delzone
dns_view_delzone performs the rcu locking required around accessing
view->zonetable.
2023-06-01 16:51:38 +02:00
Mark AndrewsandOndřej Surý ad747976bb Use rcu methods to lock access view->zonetable
dns_view_find* may be called after the final call to dns_view_detach
is made which detaches view->zonetable to permit the server to
shutdown.  We need to detect if view->zonetable is NULL during this
stage and appropriately recover.
2023-06-01 16:51:38 +02:00
Ondřej Surý f760ee3f8c Disable URCU inlining if inlined rcu_dereference() fails to compile
In some cases, the inlined version rcu_dereference() would not compile
when working on pointer to opaque struct (namely Ubuntu Jammy).  Detect
such condition in the autoconf and disable the inlining of the small
functions if it breaks the build.
2023-06-01 16:51:38 +02:00
Arаm Sаrgsyаn 1b0e7e7a50 Merge branch '4074-fix-stale-answer-client-timeout-with-clients-per-query' into 'main'
Fix a clients-per-query miscalculation bug

Closes #4074

See merge request isc-projects/bind9!7977
2023-06-01 09:21:10 +00:00
Aram Sargsyan 466a7d9b5f Add CHANGES and release notes for [GL #4074] 2023-06-01 08:14:31 +00:00
Aram Sargsyan 2ae5c4a674 Fix a clients-per-query miscalculation bug
The number of clients per query is calculated using the pending
fetch responses in the list. The dns_resolver_createfetch() function
includes every item in the list when deciding whether the limit is
reached (i.e. fctx->spilled is true). Then, when the limit is reached,
there is another calculation in fctx_sendevents(), when deciding
whether it is needed to increase the limit, but this time the TRYSTALE
responses are not included in the calculation (because of early break
from the loop), and because of that the limit is never increased.

A single client can have more than one associated response/event in the
list (currently max. two), and calculating them as separate "clients"
is unexpected. E.g. if 'stale-answer-enable' is enabled and
'stale-answer-client-timeout' is enabled and is larger than 0, then
each client will have two events, which will effectively halve the
clients-per-query limit.

Fix the dns_resolver_createfetch() function to calculate only the
regular FETCHDONE responses/events.

Change the fctx_sendevents() function to also calculate only FETCHDONE
responses/events. Currently, this second change doesn't have any impact,
because the TRYSTALE events were already skipped, but having the same
condition in both places will help prevent similar bugs in the future
if a new type of response/event is ever added.
2023-06-01 08:13:09 +00:00
Aram Sargsyan 3bb2babcd0 Add clients-per-query checks for the fetchlimit system test
Check if clients-per-query quota works as expected with or without
a positive stale-answer-client-timeout value and serve-stale answers
enabled.
2023-06-01 08:13:09 +00:00
Aram Sargsyan 7ebd055c78 Light refactoring of the fetchlimit system test
Prepare the fetchlimit system test for adding a clients-per-query
check. Change some functions and commands to accept a destination
NS IP address instead of using the hardcoded 10.53.0.3.
2023-06-01 08:13:09 +00:00
Aram Sargsyan 101d829b02 Fix fetchlimit system test issues
1. Fix the numbering.
2. Fix an artifacts rewriting issue.
3. Add missing checks of 'ret' after some checks.
2023-06-01 08:13:09 +00:00
Michal Nowak a9ec626652 Merge branch 'mnowak/alpine-3.18' into 'main'
Add Alpine Linux 3.18

See merge request isc-projects/bind9!7985
2023-05-31 10:02:52 +00:00
Michal Nowak ddb846454d Add Alpine Linux 3.18 2023-05-31 12:01:26 +02:00
Arаm Sаrgsyаn 01605a7ed1 Merge branch 'aram/statschannel-spilled-clients-counter' into 'main'
Add ClientQuota statistics channel counter

See merge request isc-projects/bind9!7978
2023-05-31 09:52:29 +00:00
Aram Sargsyan fa9172d996 Add a CHANGES note for [GL !7978] 2023-05-31 09:09:35 +00:00
Aram Sargsyan 08ebf39d1e Update the documentation of the resolver statistics counters
The reference manual doesn't document all the available resolver
statistics counters. Add information about the missing counters.
2023-05-31 09:08:58 +00:00
Aram Sargsyan 04648d7c2f Add ClientQuota statistics channel counter
This counter indicates the number of the resolver's spilled
queries due to reaching the clients per query quota.
2023-05-31 09:08:58 +00:00