2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00
Commit Graph

34804 Commits

Author SHA1 Message Date
Evan Hunt
ee068e2c39 Merge branch 'each-silence-coverity' into 'main'
silence dead code warning from coverity

See merge request isc-projects/bind9!5494
2021-10-13 16:52:20 +00:00
Evan Hunt
4595536a0d Remove dead code
Remove code from dns_zone_setparentals() that cannot be reached
now that set_serverslist() returns void.
2021-10-13 09:27:46 -07:00
Evan Hunt
068ab04310 Merge branch '828-rewrite-logfileconfig' into 'main'
logfileconfig fixes

Closes #828

See merge request isc-projects/bind9!5411
2021-10-13 16:26:02 +00:00
Evan Hunt
96980adbad CHANGES and release note for [GL #828] 2021-10-13 08:34:36 -07:00
Evan Hunt
9a9e906306 fixed a bug in rolling timestamp logfiles
due to comparing logfile suffixes as 32 bit rather than 64 bit
integers, logfiles with timestamp suffixes that should have been
removed when rolling could be left in place. this has been fixed.
2021-10-13 08:31:47 -07:00
Evan Hunt
76baed3343 rewrite logfileconfig system test
the logfileconfig system test did not conform to the style of
other tests, and was difficult to read and maintain. it has
been cleaned up and simplifeid in several ways:

- named.args used when appropriate so that named can be started with
  specified command line arguments, instead of having it launched
  directly from tests.sh
- unused root zone removed from named configuration
- an existing directory used instead of using 'mkdir' to create one
- dnssec-validation disabled to stop the server sending unnecessary queries

incidental fix: removed leftover debugging printfs from logconf.c.
2021-10-13 08:31:47 -07:00
Artem Boldariev
e857191b20 Merge branch '2940-do-not-free-tlsctx-on-socket-creation-failure' into 'main'
Do not call isc_tlsctx_free() on TLS listener creation failure

Closes #2940

See merge request isc-projects/bind9!5478
2021-10-13 15:09:07 +00:00
Artem Boldariev
6bf0183b19 Do not call isc_tlsctx_free() on TLS listener creation failure
This commit removes a superfluous call to isc_tlsctx_free() which was
leading to double free() error in a case of a TLS listener creation
failure.

The call is superfluous because the TLS context object is supposed to
be destroyed in ns_listenelt_destroy() only.
2021-10-13 17:50:42 +03:00
Ondřej Surý
8a22461fc5 Merge branch 'ondrej/use-pragma-once-header-guards' into 'main'
Use #pragma once as header guards

See merge request isc-projects/bind9!5467
2021-10-13 11:13:57 +00:00
Evan Hunt
31825521b0 Use "pragma once" in automatically generated header files
Files created by gen.c were still using old-style include guards.
2021-10-13 12:44:05 +02:00
Ondřej Surý
2fe5541cb2 Add missing .clang-format in the named headers directory
The .clang-format was missing in bin/named/include/named, add the
symlink to .clang-format.headers to match the rest of the source tree.
2021-10-13 12:43:58 +02:00
Ondřej Surý
f3635bcc14 Use #pragma once as header guards
Unify the header guard style and replace the inconsistent include guards
with #pragma once.

The #pragma once is widely and very well supported in all compilers that
BIND 9 supports, and #pragma once was already in use in several new or
refactored headers.

Using simpler method will also allow us to automate header guard checks
as this is simpler to programatically check.

For reference, here are the reasons for the change taken from
Wikipedia[1]:

> In the C and C++ programming languages, #pragma once is a non-standard
> but widely supported preprocessor directive designed to cause the
> current source file to be included only once in a single compilation.
>
> Thus, #pragma once serves the same purpose as include guards, but with
> several advantages, including: less code, avoidance of name clashes,
> and sometimes improvement in compilation speed. On the other hand,
> #pragma once is not necessarily available in all compilers and its
> implementation is tricky and might not always be reliable.

1. https://en.wikipedia.org/wiki/Pragma_once
2021-10-13 00:49:15 -07:00
Ondřej Surý
46fc798e66 Merge branch '1432-dns_name_dup-post-cleanup' into 'main'
Return void when ISC_R_SUCCESS is only returned value

Closes #1432

See merge request isc-projects/bind9!5471
2021-10-13 04:19:46 +00:00
Ondřej Surý
edfae82c82 dns/resolver.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_zone_setprimaries()
 * dns_zone_setparentals()
 * dns_zone_setparentals()
 * dns_zone_setalsonotify()
2021-10-13 05:48:51 +02:00
Ondřej Surý
f51a9d834c dns/view.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_view_adddelegationonly()
 * dns_view_excludedelegationonly()
2021-10-13 05:47:48 +02:00
Ondřej Surý
8fb4c5bb7a dns/ssu.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_ssutable_addrule()
 * dns_ssutable_create()
 * dns_ssutable_createdlz()
2021-10-13 05:47:48 +02:00
Ondřej Surý
ecb74bae0d dns/resolver.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_resolver_addalternate()
2021-10-13 05:47:48 +02:00
Ondřej Surý
b0a665d947 dns/rdata.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * name_duporclone()
2021-10-13 05:47:48 +02:00
Ondřej Surý
ffd09ec5f0 dns/lookup.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * build_event()
2021-10-13 05:47:48 +02:00
Ondřej Surý
ee735ba79d dns/catz.c: Return void when ISC_R_SUCCESS is only returned value
With isc_mem_get() and dns_name_dup() no longer being able to fail, some
functions can now only return ISC_R_SUCCESS.  Change the return type to
void for the following function(s):

 * dns_catz_options_copy()
 * dns_catz_options_setdefault()
 * dns_catz_entry_new()
 * dns_catz_entry_copy()
2021-10-13 05:47:48 +02:00
Mark Andrews
e12240150d Merge branch '2905-autoconf-check-for-struct-stat-pulls-in-fcntl-h-not-stat-h' into 'main'
Resolve "autoconf check for struct stat pulls in fcntl.h not stat.h"

Closes #2905

See merge request isc-projects/bind9!5426
2021-10-13 00:21:40 +00:00
Mark Andrews
c177c33c27 Use '#include <sys/stat.h>' for the stat structure definition
POSIX.1-2008 changed the st_atim, st_mtim, and st_ctime members of the
struct stat from time_t to struct timespec and because not all operating
systems already implemented this version of the standard or historically
deviated to include own nanosecond precision in the structure.

The autoconf script used to include <sys/fcntl.h> which contradicts
POSIX.1 as it mandates <sys/stat.h> inclusion.  Change the autoconf
check to include <sys/stat.h>.

Also fix the missing AC_MSG_RESULT([yes/no]) in the check.
2021-10-12 23:50:07 +00:00
Evan Hunt
33035de1de Merge branch 'each-cleanup-ancient' into 'main'
cleanup references to ancient named.conf options

Closes #357

See merge request isc-projects/bind9!5407
2021-10-12 21:43:34 +00:00
Evan Hunt
69e25f41ae cleanup references to ancient named.conf options
some removed options were still referenced in config.c or the ARM.
2021-10-12 14:01:57 -07:00
Evan Hunt
c7a51d24f6 Merge branch '2929-remove-master-slave-keywords' into 'main'
Replace "master/slave" terminology

Closes #2929

See merge request isc-projects/bind9!5466
2021-10-12 20:55:53 +00:00
Matthijs Mekking
d109e4d953 Remove unused bin/tests/named.conf
This file serves no useful purpose anymore and can thus be removed.
2021-10-12 13:12:34 -07:00
Matthijs Mekking
2af05beafa Replace "master/slave" terms in code
Replace some "master/slave" terminology in the code with the preferred
"primary/secondary" keywords. This also changes user output such as
log messages, and fixes a typo ("seconary") in cfg_test.c.

There are still some references to "master" and "slave" for various
reasons:

- The old syntax can still be used as a synonym.
- The master syntax is kept when it refers to master files and formats.
- This commit replaces mainly keywords that are local. If "master" or
  "slave" is used in for example a structure that is all over the
  place, it is considered out of scope for the moment.
2021-10-12 13:11:13 -07:00
Matthijs Mekking
af17ca9704 Replace "master/slave" terms in documentation
Replace those terms with the preferred "primary/secondary" keywords.
2021-10-12 13:09:04 -07:00
Matthijs Mekking
71b92d4d19 Replace "master/slave" terms in code comments
Replace those terms with the preferred "primary/secondary" keywords.
2021-10-12 13:09:00 -07:00
Matthijs Mekking
f3d3a4ff6e Replace "master/slave" terminology in tests
Replace most "master/slave" terminology in tests with the preferred
"primary/secondary", with the following exceptions:

- When testing the old syntax
- When master is used in master file and master file format terms
- When master is used in hostmaster or postmaster terms
- When master used in legacy domain names (for example in dig.batch)
- When there is no replacement (for example default-masters)
2021-10-12 13:04:00 -07:00
Ondřej Surý
570554149f Merge branch '2941-implement-incremental-hashing-resize' into 'main'
Implement incremental hash table resizing

Closes #2941

See merge request isc-projects/bind9!5476
2021-10-12 14:35:37 +00:00
Ondřej Surý
89c41fbd03 Add CHANGES and release note for [GL #2941] 2021-10-12 15:08:23 +02:00
Ondřej Surý
8c819ec366 dns/rbt.c: Implement incremental hash table resizing
Originally, the hash table used in RBT database would be resized when it
reached certain number of elements (defined by overcommit).  This was
causing resolution brownouts for busy resolvers, because the rehashing
could take several seconds to complete.  This was mitigated by
pre-allocating the hash table in the RBT database used for caching to be
large-enough as determined by max-cache-size.  The downside of this
solution was that the pre-allocated hash table could take a significant
chunk of the memory even when the resolver cache would be otherwise
empty because the default value for max-cache-size is 90% of available
memory.

Implement incremental resizing[1] to perform the rehashing gradually:

 1. During the resize, allocate the new hash table, but keep the old
    table unchanged.
 2. In each lookup or delete operation, check both tables.
 3. Perform insertion operations only in the new table.
 4. At each insertion also move r elements from the old table to the new
    table.
 5. When all elements are removed from the old table, deallocate it.

To ensure that the old table is completely copied over before the new
table itself needs to be enlarged, it is necessary to increase the
size of the table by a factor of at least (r + 1)/r during resizing.

In our implementation r is equal to 1.

The downside of this approach is that the old table and the new table
could stay in memory for longer when there are no new insertions into
the hash table for prolonged periods of time as the incremental
rehashing happens only during the insertions.

The upside of this approach is that it's no longer necessary to
pre-allocate large hash table, because the RBT hash table rehashing
doesn't cause resolution brownouts anymore and thus we can use the
memory as needed.

1. https://en.m.wikipedia.org/wiki/Hash_table#Dynamic_resizing
2021-10-12 15:01:53 +02:00
Matthijs Mekking
0590d71977 Merge branch '1316-toggle-the-default-of-dnssec-dnskey-kskonly-to-yes' into 'main'
Change default of dnssec-dnskey-kskonly to yes

Closes #1316

See merge request isc-projects/bind9!5472
2021-10-12 12:38:16 +00:00
Matthijs Mekking
0870d666dc Add CHANGES and release note for [GL #1316] 2021-10-12 13:46:29 +02:00
Matthijs Mekking
2abad4d969 Change default of dnssec-dnskey-kskonly to yes
The extra RRSIG on DNSKEY, CDS and CDNSKEY RRsets add to the payload,
without having added value.
2021-10-12 13:45:44 +02:00
Ondřej Surý
bfabf5489e Merge branch '1610-enable-UseSTD3ASCIIRules-in-idn2' into 'main'
Enable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions

Closes #1610

See merge request isc-projects/bind9!5464
2021-10-12 11:05:19 +00:00
Ondřej Surý
092200bffd Add CHANGES and release note for [GL #1610] 2021-10-12 12:13:33 +02:00
Matthijs Mekking
f275d42a02 Correct --with-idn references to --with-libidn2
The documentation and feature-test were using '--with-idn' but the
configure script doesn't recognize this option. The correct option to
enable IDN support is '--with-libidn2'.
2021-10-12 12:13:33 +02:00
Ondřej Surý
08008c4409 Add idna test for UseSTD3ASCIIRules=true
Add test to encode unicode sequence that encodes differently with
UseSTD3ASCIIRules=false which is default with idn2 >= 2.0.3 and
UseSTD3ASCIIRules=true which is what should be used to encode hostnames
and domains.
2021-10-12 12:11:52 +02:00
Ondřej Surý
ef8aa91740 Enable IDN2_USE_STD3_ASCII_RULES to idn2 conversion functions
libidn2 defaults to UseSTD3ASCIIRules=false. That allows arbitrary ASCII
characters to show up in the toASCII output, including space and
underscore.  Enable IDN2_USE_STD3_ASCII_RULES to the libidn2 conversion
to disallow additional characters from the conversion (see Validity
Criteria[1]).
2021-10-12 12:11:52 +02:00
Ondřej Surý
efed341c2e Merge branch '2933-bump-the-default-clang-version-to-13' into 'main'
Change the LLVM tools version to 13

Closes #2933

See merge request isc-projects/bind9!5484
2021-10-12 09:29:13 +00:00
Ondřej Surý
ed95f9fba3 Update the source code formatting using clang-format-13
clang-format-13 fixed some of the formatting that clang-format-12 got
wrong.  Update the formatting.
2021-10-12 11:14:40 +02:00
Ondřej Surý
16916ab3e3 Change the LLVM tools version to 13
LLVM 13.0.0 was released on 4. October 2021, change the default version
to the current stable.
2021-10-12 11:14:40 +02:00
Michał Kępień
840e71eeae Merge branch 'michal/properly-handle-jemalloc-autoconf-variables' into 'main'
Properly handle JEMALLOC_* Autoconf variables

See merge request isc-projects/bind9!5486
2021-10-12 09:09:06 +00:00
Michał Kępień
5178ba4cf2 Properly handle JEMALLOC_* Autoconf variables
The AX_CHECK_JEMALLOC() m4 macro sets the JEMALLOC_CFLAGS variable, not
JEMALLOC_CPPFLAGS.  Furthermore, the JEMALLOC_CFLAGS and JEMALLOC_LIBS
variables should only be included in the build flags if jemalloc was
successfully configured.  Tweak lib/isc/Makefile.am accordingly.
2021-10-12 10:44:30 +02:00
Mark Andrews
60e444848c Merge branch '2935-cid-339035-1-of-1-explicit-null-dereferenced-forward_null' into 'main'
Resolve "CID 339035 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)"

Closes #2935

See merge request isc-projects/bind9!5470
2021-10-11 23:16:22 +00:00
Mark Andrews
c48ca52851 Add CHANGES for [GL #2935] 2021-10-12 09:57:24 +11:00
Mark Andrews
0378c05ba0 Fix cleanup of signature buffer in dns_dnssec_signmessage
A NULL pointer could be freed if error handling occured.
2021-10-12 09:56:44 +11:00
Michał Kępień
e112afa156 Merge branch '2899-placeholder' into 'main'
Add placeholder for GL #2899

See merge request isc-projects/bind9!5479
2021-10-08 10:07:46 +00:00