Commit Graph
11235 Commits
Author SHA1 Message Date
Mark Andrews ecdb80ca85 exercise dns_rdata_additionaldata
(cherry picked from commit 649a34d628)
2020-01-14 09:17:10 +00:00
Mark Andrews 83b5274f84 call dns_rdata_towire on valid output from dns_rdata_fromtext and dns_rdata_fromwire
(cherry picked from commit 5e74550740)
2020-01-14 09:17:10 +00:00
Mark AndrewsandOndřej Surý 3a9cdba3d8 Add is_leaf and send_to_prune_tree.
Add is_leaf and send_to_prune_tree to make the logic easier
to understand in cleanup_dead_nodes and decrement_reference.

(cherry picked from commit c6efc0e50f)
2020-01-14 08:35:37 +01:00
Mark AndrewsandOndřej Surý 4db29f1f7d Testing node->down requires the tree lock to be held.
In decrement_reference only test node->down if the tree lock
is held.  As node->down is not always tested in
decrement_reference we need to test that it is non NULL in
cleanup_dead_nodes prior to removing the node from the rbt
tree.  Additionally it is not always possible to aquire the
node lock and reactivate a node when adding parent nodes.
Reactivate such nodes in cleanup_dead_nodes if required.

(cherry picked from commit 176b23b6cd)
2020-01-14 08:35:37 +01:00
Michał Kępień 28fe27e47e Properly detect MMDB lookup failures
Only comparing the value of the integer passed as the last argument to
MMDB_lookup_sockaddr() against MMDB_SUCCESS is not enough to ensure that
an MMDB lookup was successful - the 'found_entry' field of the
MMDB_lookup_result_s structure returned by that function also needs to
be true or else the remaining contents of that structure should be
ignored as the lookup failed.  Extend the relevant logical condition in
get_entry_for() to ensure the latter does not return incorrect MMDB
entries for IP addresses which do not belong to any subnet defined in a
given GeoIP2 database.

(cherry picked from commit 814da1c808)
2020-01-13 15:06:35 +01:00
Michał Kępień daade37977 Handle catopen() errors
musl libc's implementation of catgets() crashes when its first argument
is -1 instead of a proper message catalog descriptor.  Prevent that from
happening by making isc_msgcat_get() return the default text if the
prior call to catopen() returns an error.
2020-01-13 14:03:11 +01:00
Mark Andrews 939f2fa2f5 formally discard return value 2020-01-13 05:07:13 +00:00
Evan Hunt 50ce299518 update copyright year to 2020 2020-01-02 21:50:03 -08:00
Mark Andrews 71d8c73d8f remove duplicate #includes
(cherry picked from commit 848c1c8b8b)
2019-12-23 08:20:59 +11:00
Mark Andrews a4762ee293 revert d10fbdec for lib/dns/gen.c as it is a build platform executable
(cherry picked from commit 7278f2529a)
2019-12-23 08:20:58 +11:00
Mark Andrews 93e0d11e73 Refactor loop body as copy_non_dnssec_records.
(cherry picked from commit d26e125438)
2019-12-20 22:08:04 +11:00
Ondřej SurýandMark Andrews be646d9d3e Add failure handling when iterators don't end with ISC_R_NOMORE
(cherry picked from commit bff83b9480)
2019-12-20 22:06:26 +11:00
Ondřej SurýandMark Andrews 20e458e5f7 Refactor receive_secure_db to make the variables and code flow around the iterator more local
(cherry picked from commit 6012479419)
2019-12-20 22:06:26 +11:00
Mark Andrews f1a8215a44 Call dns_dbiterator_destroy earlier to prevent potential deadlock.
(cherry picked from commit 9d8f9cc8f2)
2019-12-20 22:06:25 +11:00
Mark Andrews 261c84d91d fix variable name in conditional block 2019-12-19 09:27:44 +11:00
Ondřej SurýandMark Andrews f8cab45c3b Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace
(cherry picked from commit 8120088ec7)
2019-12-18 11:11:48 +11:00
Mark Andrews 7c94d2cd7d acquire task lock before calling push_readyq for task->flags access 2019-12-12 22:54:15 +00:00
Ondřej Surý 3bac7e9807 Ensure all zone_settimer() calls are done on locked zone
(cherry picked from commit cf48e8eb32)
2019-12-12 16:16:59 +01:00
Mark Andrews a52189e8e6 give zspill its own lock 2019-12-12 20:41:44 +11:00
Tinderbox User ed6da5ec3d prep 9.11.14 2019-12-12 05:01:05 +00:00
Mark Andrews 020c29a8c8 Note bucket lock requirements.
(cherry picked from commit 13aaeaa06f)
2019-12-11 11:08:03 +11:00
Mark Andrews 89cf1dc665 lock access to fctx->nqueries
(cherry picked from commit 5589748eca)
2019-12-11 11:02:21 +11:00
Mark Andrews 4263b2ea21 address deadlock introduced in cd2469d3cd
(cherry picked from commit fd52417f71)
2019-12-10 20:24:05 +00:00
Ondřej SurýandDiego Fronza e50abe8a70 Cleanup the isc_stats code 2019-12-04 19:39:57 -03:00
Diego Fronza 8680c367cd Fix tcp-higwater stats for some specific platforms
The previous code had some errors that would be triggered on platforms
without stdatomics but with support for xadd assembly instruction.

The major error was combining two uint32_t values from the
multifield atomic structure using a logical AND '&&' instead of a
bitwise OR '|'.

Some preprocessor rules were redundant and thus were simplified,
regarding the definition of ISC_STATS_USEMULTIFIELDS macro.

Correctly changed rwlock type to read on isc_stats_get_counter.
2019-12-04 19:39:56 -03:00
Mark Andrews 56af72c1d4 Assign fctx->client when fctx is created rather when the join happens.
This prevents races on fctx->client whenever a new fetch joins a existing
fetch (by calling fctx_join) as it is now invariant for the active life of
fctx.

(cherry picked from commit 9ca6ad6311)
2019-12-03 23:39:47 +11:00
Mark Andrews 882d79b2a3 r/w of rbtdb->current_version requires that rbtdb->lock be held
(cherry picked from commit cd2469d3cd)
2019-12-03 16:50:06 +11:00
Mark Andrews 37eb8e0d6c define and use FCTX_ATTR_SET and FCTX_ATTR_CLR 2019-12-03 11:41:05 +11:00
Mark Andrews 3114ff2346 make FCTX_ATTR_SHUTTINGDOWN a independent bool 2019-12-03 08:51:44 +11:00
Mark Andrews 1c61f129c3 rdataset_setownercase and rdataset_getownercase need to obtain a node lock
(cherry picked from commit 637b2c4e51)
2019-11-29 07:13:04 +11:00
Mark AndrewsandOndřej Surý 449f96c7bb add comments 'tree_lock(write) must be held'
(cherry picked from commit 8f6aaa7230)
2019-11-27 18:06:05 +01:00
Mark AndrewsandOndřej Surý 37f6845980 rbtnode->nsec needs to be read while holding the tree lock
(cherry picked from commit 7cad3b2e91)
2019-11-27 18:06:05 +01:00
Mark Andrews d74a6a96c3 move maxbuffers test to allocate_udp_buffer
(cherry picked from commit 26a93d77aa)
2019-11-26 11:53:33 +11:00
Mark Andrews 1d928de33e Lock dispatch manager buffer_lock before accessing buffers;
Only test buffers for UDP dispatches.

(cherry picked from commit 011af4de71)
2019-11-26 11:53:33 +11:00
Mark Andrews dcb21f39b6 lock disp->mgr before reading disp->mgr->buffers
(cherry picked from commit afc7389ce8)
2019-11-26 11:53:33 +11:00
Mark Andrews 9cffeb606a lock dispatch before reporting state
(cherry picked from commit 3075445ed6)
2019-11-23 08:25:47 +11:00
Mark Andrews 9d4f5f88f3 Conditional compilation of lock_callback was inconsistent with
conditional use of the function when forcing BIND to build with
older and unsupported versions of OpenSSL.
2019-11-21 10:59:16 +11:00
Evan Hunt 99203103b7 Merge tag 'v9_11_13' into merge-v9_11_13 2019-11-20 13:43:34 -08:00
Mark AndrewsandOndřej Surý a64c9fae62 use update_recordsandbytes in rbt_datafixer
(cherry picked from commit 7d4d64340e)
2019-11-20 01:01:52 +08:00
Mark AndrewsandOndřej Surý cf78ae96e5 always obtain write lock when updating version->{records,bytes}
(cherry picked from commit 0cda448248)
2019-11-20 01:01:51 +08:00
Ondřej SurýandOndřej Surý ab4e6c2fe7 lib/dns/resolver.c: Call dns_adb_endudpfetch() only for UDP queries
The dns_adb_beginudpfetch() is called only for UDP queries, but
the dns_adb_endudpfetch() is called for all queries, including
TCP.  This messages the quota counting in adb.c.

(cherry picked from commit a5189eefa5)
2019-11-19 03:48:47 +08:00
Ondřej Surý d2c86b2159 Internally, use {PATH,NAME}_MAX instead of ISC_DIR_{PATH,NAME}MAX 2019-11-12 09:31:40 +01:00
Samuel ThibaultandOndřej Surý 88061c2acb hurd: Fix build
Move PATH_MAX, NAME_MAX, IOV_MAX default definitions to the common
<isc/platform.h>.

(cherry picked from commit d10fbdec84)
2019-11-12 09:22:15 +01:00
Tinderbox User 336d24089b prep 9.11.13 2019-11-06 21:26:36 +00:00
Michał Kępień 4876a88fc0 Do not use <sys/sysctl.h> on Linux
glibc 2.30 deprecated the <sys/sysctl.h> header [1].  However, that
header is still used on other Unix-like systems, so only prevent it from
being used on Linux, in order to prevent compiler warnings from being
triggered.

[1] https://sourceware.org/ml/libc-alpha/2019-08/msg00029.html

(cherry picked from commit 65a8b53bd0)
2019-11-06 21:11:20 +01:00
Ondřej SurýandMichał Kępień b154ef1f86 Describe the polynomial backoff curve used in the quota adjustment
(cherry picked from commit 56ef09c3a1)
2019-11-06 20:50:46 +01:00
Witold KręcickiandMatthijs Mekking bc96d7b3bb Jitter signatures times when adding dynamic records.
When doing regular signing expiry time is jittered to make sure
that the re-signing times are not clumped together. This expands
this behaviour to expiry times of dynamically added records.

When incrementally re-signing a zone use the full jitter range if
the server appears to have been offline for greater than 5 minutes
otherwise use a small jitter range of 3600 seconds.  This will stop
the signatures becoming more clustered if the server has been off
line for a significant period of time (> 5 minutes).

Manually edits: resolve conflicts, replace isc_random_uniform
with isc_random_jitter.

(cherry picked from commit 6b2fd40269)
2019-11-06 16:30:50 +01:00
Ondřej Surý 55b0da1381 Backport isc_quota_getused() function 2019-11-06 12:54:40 +01:00
Ondřej Surý e8bf3c60f2 Avoid an extra atomic_load() call 2019-11-06 12:54:40 +01:00
Diego FronzaandOndřej Surý 4ad2ab54cd Added TCP high-water statistics variable
This variable will report the maximum number of simultaneous tcp clients
that BIND has served while running.

It can be verified by running rndc status, then inspect "tcp high-water:
count", or by generating statistics file, rndc stats, then inspect the
line with "TCP connection high-water" text.

The tcp-highwater variable is atomically updated based on an existing
tcp-quota system handled in ns/client.c.

(cherry picked from commit 66fe8627de)
2019-11-06 12:54:40 +01:00