Commit Graph

33384 Commits

Author SHA1 Message Date
Ondřej Surý
a12938e183 Add rbtdb setownercase/getownercase unit test
This commit adds a unittest that tests private rdataset_getownercase()
and rdataset_setownercase() methods from rbtdb.c.  The test setups
minimal mock dns_rbtdb_t and dns_rbtdbnode_t data structures.

As the rbtdb methods are generally hidden behind layers and layers, we
include the "rbtdb.c" directly from rbtdb_test.c, and thus we can use
the private methods and data structures directly.  This also opens up
opportunity to add more unittest for the rbtdb private functions without
going through all the layers.

(cherry picked from commit c7a11bd5b4)
2021-06-23 17:31:13 +02:00
Matthijs Mekking
c8b2245314 Merge branch 'matthijs-2778-more-tests-v9_16' into 'v9_16'
Add more test cases for #2778 (9.16)

See merge request isc-projects/bind9!5224
2021-06-23 15:10:04 +00:00
Matthijs Mekking
6f75c74a37 Add more test cases for #2778
Add three more test cases that detect a configuration error if the
key-directory is inherited but has the same value for a zone in a
different view with a deviating DNSSEC policy.

(cherry picked from commit 84cfd95e95722191195cd4b09ce6f19960868597)
2021-06-23 15:31:30 +02:00
Petr Špaček
31e2cc4b5c Merge branch 'v9_16_18-release' into 'v9_16'
Merge 9.16.18 release branch

See merge request isc-projects/bind9!5221
2021-06-23 12:42:26 +00:00
Petr Špaček
73ca01b564 Set up release notes for BIND 9.16.19 2021-06-23 14:08:31 +02:00
Michał Kępień
1960d70759 prep 9.16.18 2021-06-23 13:46:14 +02:00
Michał Kępień
cd3a1536e2 Merge branch 'michal/prepare-documentation-for-bind-9.16.18' into 'v9_16_18-release'
Prepare documentation for BIND 9.16.18

See merge request isc-private/bind9!305
2021-06-23 13:43:53 +02:00
Michał Kępień
9021863afe Prepare release notes for BIND 9.16.18 2021-06-23 13:43:48 +02:00
Michał Kępień
fb3474f967 Tweak and reword release notes 2021-06-23 13:37:52 +02:00
Michał Kępień
b012902e7e Tweak and reword recent CHANGES entries 2021-06-23 13:36:52 +02:00
Ondřej Surý
64f34dddf5 Merge branch '2788-use-tolower-toupper-isupper-from-ctype-h-v9_16' into 'v9_16'
Use tolower(), toupper() and isupper() from ctype.h (v9.16)

See merge request isc-projects/bind9!5218
2021-06-23 11:08:18 +00:00
Ondřej Surý
0167c4a898 Use POSIX tolower(), toupper() and isupper() functions
In the code that rdataset_setownercase() and rdataset_getownercase() we
now use tolower()/toupper()/isupper() functions appropriately instead of
rolling our own code.

(cherry picked from commit 7ccbe52060)
2021-06-23 11:50:11 +02:00
Ondřej Surý
a5e837cfda Don't set locale globally, just use it when needed
Previously, we would set the locale on a global level and that could
possibly lead to different behaviour in underlying functions.  In this
commit, we change to code to use the system locale only when calling the
libidn2 functions and reset the locale back to "POSIX" when exiting the
libidn2 code.

(cherry picked from commit 0d35b3f1a9)
2021-06-23 11:50:09 +02:00
Michał Kępień
b96584ce14 Merge branch '1802-improve-description-of-mirror-zone-validation-v9_16' into 'v9_16'
[v9_16] Improve description of mirror zone validation

See merge request isc-projects/bind9!5216
2021-06-22 21:06:26 +00:00
Michał Kępień
6ae474ebf9 Improve description of mirror zone validation
Expand the description of mirror zones in the ARM by adding a brief
discussion of how the validation process works for AXFR and IXFR.  Move
the paragraph mentioning the "file" option higher up.  Apply minor
stylistic and whitespace-related tweaks to the relevant section of the
ARM.

(cherry picked from commit d877aa9adf)
2021-06-22 22:54:32 +02:00
Michał Kępień
6d2f540e5e Merge branch '2279-expand-description-of-the-max-cache-size-option-v9_16' into 'v9_16'
[v9_16] Rework description of the "max-cache-size" option

See merge request isc-projects/bind9!5214
2021-06-22 19:50:08 +00:00
Petr Špaček
9505dd0c4f Rework description of the "max-cache-size" option
Improve the description of the "max-cache-size" option in the ARM by
focusing on its meaning for multiple views and default values.
Add mention of a hash table preallocation.

(cherry picked from commit a67ceb8dda)
2021-06-22 21:38:52 +02:00
Michał Kępień
09dbebd964 Merge branch '2777-use-minimal-sized-caches-for-non-recursive-views-v9_16' into 'v9_16'
[v9_16] Use minimal-sized caches for non-recursive views

See merge request isc-projects/bind9!5211
2021-06-22 13:56:36 +00:00
Michał Kępień
87aa343424 Add CHANGES entry
(cherry picked from commit f9500f824d)
2021-06-22 15:32:27 +02:00
Michał Kępień
7427da27fa Hardcode "max-cache-size" for the "_bind" view
The built-in "_bind" view does not allow recursion and therefore does
not need a large cache database.  However, as "max-cache-size" is not
explicitly set for that view in the default configuration, it inherits
that setting from global options.  Set "max-cache-size" for the built-in
"_bind" view to a fixed value (2 MB, i.e. the smallest allowed value) to
prevent needlessly preallocating memory for its cache RBT hash table.

(cherry picked from commit 86698ded32)
2021-06-22 15:32:27 +02:00
Michał Kępień
126436cc96 Use minimal-sized caches for non-recursive views
Currently the implicit default for the "max-cache-size" option is "90%".
As this option is inherited by all configured views, using multiple
views can lead to memory exhaustion over time due to overcommitment.
The "max-cache-size 90%;" default also causes cache RBT hash tables to
be preallocated for every configured view, which does not really make
sense for views which do not allow recursion.

To limit this problem's potential for causing operational issues, use a
minimal-sized cache for views which do not allow recursion and do not
have "max-cache-size" explicitly set (either in global configuration or
in view configuration).

For configurations which include multiple views allowing recursion,
adjusting "max-cache-size" appropriately is still left to the operator.

(cherry picked from commit 86541b39d3)
2021-06-22 15:32:27 +02:00
Matthijs Mekking
ff089d73e8 Merge branch '2783-in-view-dnssec-policy-deadlock-v9_16' into 'v9_16'
Fix in-view /w dnssec-policy deadlock at startup (9.16)

See merge request isc-projects/bind9!5204
2021-06-22 08:13:14 +00:00
Matthijs Mekking
b2851b3c5f Add changes and notes for [#2783]
(cherry picked from commit dae42dc9d4)
2021-06-22 09:25:54 +02:00
Matthijs Mekking
bb1f0404ab Fix deadlock issue with key-directory and in-view
When locking key files for a zone, we iterate over all the views and
lock a mutex inside the zone structure. However, if we envounter an
in-view zone, we will try to lock the key files twice, one time for
the home view and one time for the in-view view. This will lead to
a deadlock because one thread is trying to get the same lock twice.

(cherry picked from commit 42c601ae14)
2021-06-22 09:25:46 +02:00
Matthijs Mekking
e7401506e4 Add test case for in-view with dnssec-policy
Add a test case for a zone that uses 'in-view' and 'dnssec-policy'.
BIND should not deadlock.

(cherry picked from commit acd83881ff)
2021-06-22 09:25:40 +02:00
Michał Kępień
7dc60c5953 Merge branch '2778-unique-key-directories-reported-as-reused-in-9-16-17-regression-vs-9-16-16-v9_16' into 'v9_16'
Checking of key-directory and dnssec-policy was broken

See merge request isc-projects/bind9!5197
2021-06-18 09:50:08 +00:00
Mark Andrews
0df4c40d64 Add release note for [GL #2778]
(cherry picked from commit 85033788d3)
2021-06-18 17:29:41 +10:00
Mark Andrews
01f547b34b Add CHANGES for [GL #2778]
(cherry picked from commit bd1419a9e8)
2021-06-18 17:29:41 +10:00
Mark Andrews
efbf4ed5e1 Checking of key-directory and dnssec-policy was broken
the checks failed to account for key-directory being inheritable.

(cherry picked from commit d1e283ede1)
2021-06-18 17:29:41 +10:00
Mark Andrews
d3268ea9ad Merge branch '2779-name-in-answer-doesn-t-match-the-name-in-query-v9_16' into 'v9_16'
Add w and W to maptoupper and maptolower tables

See merge request isc-projects/bind9!5196
2021-06-18 07:14:37 +00:00
Mark Andrews
467c795bfe Add release note for [GL #2779]
(cherry picked from commit 7372e9a60d)
2021-06-18 16:36:38 +10:00
Mark Andrews
c3fdbcb1c1 Add CHANGES note for [GL #2779]
(cherry picked from commit 8c60debc18)
2021-06-18 16:36:38 +10:00
Mark Andrews
ab597b8b91 Check wild card expansions by code point
(cherry picked from commit c65dc2f7dc)
2021-06-18 16:36:37 +10:00
Mark Andrews
52cc9ff372 Add w and W to maptoupper and maptolower tables
(cherry picked from commit 08eeebb6a7)
2021-06-18 16:35:19 +10:00
Michal Nowak
ebc6fece77 Merge branch 'mnowak/alpine-3.14-v9_16' into 'v9_16'
[v9_16] Add Alpine Linux 3.14

See merge request isc-projects/bind9!5192
2021-06-17 16:24:54 +00:00
Michal Nowak
387fbbd4df Add Alpine Linux 3.14
(cherry picked from commit 80f828bc37)
2021-06-17 18:19:18 +02:00
Michał Kępień
76cd42fb56 Merge branch '2770-allow-hash-tables-for-cache-rbts-to-be-grown-v9_16' into 'v9_16'
[v9_16] Allow hash tables for cache RBTs to be grown

See merge request isc-projects/bind9!5191
2021-06-17 15:44:38 +00:00
Michał Kępień
cc6d89f913 Add CHANGES entry
(cherry picked from commit 0c59f1362c)
2021-06-17 17:17:37 +02:00
Michał Kępień
c745b14203 Allow resetting hash table size limits for DNS DBs
When "max-cache-size" is changed to "unlimited" (or "0") for a running
named instance (using "rndc reconfig"), the hash table size limit for
each affected cache DB is not reset to the maximum possible value,
preventing those hash tables from being allowed to grow as a result of
new nodes being added.

Extend dns_rbt_adjusthashsize() to interpret "size" set to 0 as a signal
to remove any previously imposed limits on the hash table size.  Adjust
API documentation for dns_db_adjusthashsize() accordingly.  Move the
call to dns_db_adjusthashsize() from dns_cache_setcachesize() so that it
also happens when "size" is set to 0.

(cherry picked from commit 6b77583f54)
2021-06-17 17:17:37 +02:00
Michał Kępień
c2d9c14354 Allow hash tables for cache RBTs to be grown
Upon creation, each dns_rbt_t structure has its "maxhashbits" field
initialized to the value of the RBT_HASH_MAX_BITS preprocessor macro,
i.e. 32.  When the dns_rbt_adjusthashsize() function is called for the
first time for a given RBT (for cache RBTs, this happens when they are
first created, i.e. upon named startup), it lowers the value of the
"maxhashbits" field to the number of bits required to index the
requested number of hash table slots.  When a larger hash table size is
subsequently requested, the value of the "maxhashbits" field should be
increased accordingly, up to RBT_HASH_MAX_BITS.  However, the loop in
the rehash_bits() function currently ensures that the number of bits
necessary to index the resized hash table will not be larger than
rbt->maxhashbits instead of RBT_HASH_MAX_BITS, preventing the hash table
from being grown once the "maxhashbits" field of a given dns_rbt_t
structure is set to any value lower than RBT_HASH_MAX_BITS.

Fix by tweaking the loop guard condition in the rehash_bits() function
so that it compares the new number of bits used for indexing the hash
table against RBT_HASH_MAX_BITS rather than rbt->maxhashbits.

(cherry picked from commit c096f91451)
2021-06-17 17:17:37 +02:00
Michał Kępień
b5e164d87a Merge branch '2763-increase-timeout-in-the-rndc-deadlock-test-v9_16' into 'v9_16'
[v9_16] Increase timeout in the rndc deadlock test

See merge request isc-projects/bind9!5190
2021-06-17 10:45:12 +00:00
Michał Kępień
b9c9ed6197 Increase timeout in the rndc deadlock test
The timeout originally picked for "rndc status" invocations (2 seconds)
in the test attempting to reproduce a deadlock caused by running
multiple "rndc addzone", "rndc modzone", and "rndc delzone" commands
concurrently causes intermittent failures of the "addzone" system test
in GitLab CI.  Increase the timeout to 10 seconds to make such failures
less probable.  Adjust code comments accordingly.

(cherry picked from commit ac4c58e8ce)
2021-06-17 12:41:01 +02:00
Michał Kępień
65b74626e4 Merge branch 'v9_16_17-release' into 'v9_16'
Merge 9.16.17 release branch

See merge request isc-projects/bind9!5187
2021-06-16 20:38:37 +00:00
Michał Kępień
a6b5004a72 Set up release notes for BIND 9.16.18 2021-06-16 22:29:27 +02:00
Tinderbox User
84cc19b692 Merge branch 'prep-release' into v9_16_17-release 2021-06-16 22:29:27 +02:00
Michał Kępień
043f7b5ec1 Merge branch 'michal/prepare-documentation-for-bind-9.16.17' into 'v9_16_17-release'
Prepare documentation for BIND 9.16.17

See merge request isc-private/bind9!300
2021-06-16 22:29:27 +02:00
Tinderbox User
13b9f23cce prep 9.16.17 2021-06-16 22:29:27 +02:00
Michał Kępień
b926b343ed Prepare release notes for BIND 9.16.17 2021-06-16 22:29:27 +02:00
Michał Kępień
f481179977 Reorder release notes 2021-06-16 22:29:27 +02:00
Michał Kępień
a3bbfaf1ff Tweak and reword release notes 2021-06-16 22:29:27 +02:00