]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 years agoRemove tkey_test (which is no-op anyway)
Ondřej Surý [Wed, 12 Feb 2020 13:15:10 +0000 (14:15 +0100)] 
Remove tkey_test (which is no-op anyway)

6 years agoUpdate the definition files for Windows
Ondřej Surý [Tue, 16 Jul 2019 20:33:15 +0000 (22:33 +0200)] 
Update the definition files for Windows

6 years agoUse clang-format to reformat the source files
Ondřej Surý [Wed, 12 Feb 2020 12:59:18 +0000 (13:59 +0100)] 
Use clang-format to reformat the source files

6 years agoImport Linux kernel .clang-format with small modifications
Ondřej Surý [Tue, 16 Jul 2019 20:23:06 +0000 (22:23 +0200)] 
Import Linux kernel .clang-format with small modifications

6 years agoMerge branch 'michal/minor-README-tweaks' into 'master'
Michał Kępień [Wed, 12 Feb 2020 10:37:53 +0000 (10:37 +0000)] 
Merge branch 'michal/minor-README-tweaks' into 'master'

Minor README tweaks

See merge request isc-projects/bind9!3036

6 years agoMinor CHANGES tweaks
Michał Kępień [Wed, 12 Feb 2020 10:23:48 +0000 (11:23 +0100)] 
Minor CHANGES tweaks

6 years agoMerge branch '1616-autosign-not-waiting-long-enough-for-zone-to-be-signed-v9_11-and...
Mark Andrews [Wed, 12 Feb 2020 10:07:27 +0000 (10:07 +0000)] 
Merge branch '1616-autosign-not-waiting-long-enough-for-zone-to-be-signed-v9_11-and-maybe-others-master' into 'master'

wait for apex NSEC3 to be generated

Closes #1616

See merge request isc-projects/bind9!3043

6 years agowait for apex NSEC3 to be generated
Mark Andrews [Wed, 12 Feb 2020 01:47:09 +0000 (12:47 +1100)] 
wait for apex NSEC3 to be generated

(cherry picked from commit c99ad5c8c7d24f7faa339fe86e8ed1515b4a24ce)

6 years agoMerge branch 'mnowak/coverity2' into 'master'
Michal Nowak [Wed, 12 Feb 2020 09:45:27 +0000 (09:45 +0000)] 
Merge branch 'mnowak/coverity2' into 'master'

Add Coverity Scan to CI

See merge request isc-projects/bind9!2979

6 years agoAdd Coverity Scan to CI
Michal Nowak [Wed, 12 Feb 2020 09:45:27 +0000 (09:45 +0000)] 
Add Coverity Scan to CI

This job requires two CI variables to be set:

  - COVERITY_SCAN_PROJECT_NAME: project name, which is associated with
    the BIND branch for which this job is executed, e.g. "bind-master",

  - COVERITY_SCAN_TOKEN: project token.

6 years agoMerge branch '1602-rpz-system-test-failed-because-protoype-responses-timed-out' into...
Mark Andrews [Wed, 12 Feb 2020 08:32:54 +0000 (08:32 +0000)] 
Merge branch '1602-rpz-system-test-failed-because-protoype-responses-timed-out' into 'master'

Resolve "rpz system test failed because protoype responses timed out."

Closes #1602

See merge request isc-projects/bind9!3040

6 years agospin waiting for prototype dig responses
Mark Andrews [Wed, 12 Feb 2020 02:54:17 +0000 (13:54 +1100)] 
spin waiting for prototype dig responses

6 years agoMerge branch 'wpk/netmgr-pools-unlimited' into 'master'
Witold Krecicki [Wed, 12 Feb 2020 08:10:31 +0000 (08:10 +0000)] 
Merge branch 'wpk/netmgr-pools-unlimited' into 'master'

Don't limit the size of uvreq/nmhandle pool artificially.

See merge request isc-projects/bind9!3031

6 years agoMinor README tweaks
Stephen Morris [Tue, 11 Feb 2020 14:14:50 +0000 (15:14 +0100)] 
Minor README tweaks

6 years agoDon't limit the size of uvreq/nmhandle pool artificially.
Witold Kręcicki [Mon, 10 Feb 2020 13:00:36 +0000 (14:00 +0100)] 
Don't limit the size of uvreq/nmhandle pool artificially.

There was a hard limit set on number of uvreq and nmhandles
that can be allocated by a pool, but we don't handle a situation
where we can't get an uvreq. Don't limit the number at all,
let the OS deal with it.

6 years agoMerge branch '1428-possible-data-race-in-rbtdb-happens-occasionally-on-ppc64le' into...
Ondřej Surý [Tue, 11 Feb 2020 10:42:52 +0000 (10:42 +0000)] 
Merge branch '1428-possible-data-race-in-rbtdb-happens-occasionally-on-ppc64le' into 'master'

Convert all atomic operations in isc_rwlock to release-acquire memory ordering

Closes #1428

See merge request isc-projects/bind9!2985

6 years agoConvert all atomic operations in isc_rwlock to release-acquire memory ordering
Ondřej Surý [Sat, 1 Feb 2020 09:48:20 +0000 (10:48 +0100)] 
Convert all atomic operations in isc_rwlock to release-acquire memory ordering

The memory ordering in the rwlock was all wrong, I am copying excerpts
from the https://en.cppreference.com/w/c/atomic/memory_order#Relaxed_ordering
for the convenience of the reader:

  Relaxed ordering

  Atomic operations tagged memory_order_relaxed are not synchronization
  operations; they do not impose an order among concurrent memory
  accesses. They only guarantee atomicity and modification order
  consistency.

  Release-Acquire ordering

  If an atomic store in thread A is tagged memory_order_release and an
  atomic load in thread B from the same variable is tagged
  memory_order_acquire, all memory writes (non-atomic and relaxed atomic)
  that happened-before the atomic store from the point of view of thread
  A, become visible side-effects in thread B. That is, once the atomic
  load is completed, thread B is guaranteed to see everything thread A
  wrote to memory.

  The synchronization is established only between the threads releasing
  and acquiring the same atomic variable. Other threads can see different
  order of memory accesses than either or both of the synchronized
  threads.

Which basically means that we had no or weak synchronization between
threads using the same variables in the rwlock structure.  There should
not be a significant performance drop because the critical sections were
already protected by:

  while(1) {
    if (relaxed_atomic_operation) {
      break;
    }
    LOCK(lock);
    if (!relaxed_atomic_operation) {
      WAIT(sem, lock);
    }
    UNLOCK(lock)l
  }

I would add one more thing to "Don't do your own crypto, folks.":

  - Also don't do your own locking, folks.

6 years agoMerge branch '1598-dnssec-policy-doc' into 'master'
Evan Hunt [Tue, 11 Feb 2020 09:01:36 +0000 (09:01 +0000)] 
Merge branch '1598-dnssec-policy-doc' into 'master'

Resolve "Improve dnssec-policy documentation"

Closes #1598

See merge request isc-projects/bind9!3023

6 years agorevise dnssec-policy documentation
Evan Hunt [Sat, 8 Feb 2020 07:41:18 +0000 (23:41 -0800)] 
revise dnssec-policy documentation

6 years agoMerge branch 'ondrej/remove-OpenSSL-engine-specification-in-label' into 'master'
Ondřej Surý [Mon, 10 Feb 2020 16:02:23 +0000 (16:02 +0000)] 
Merge branch 'ondrej/remove-OpenSSL-engine-specification-in-label' into 'master'

Cleanup support for specifying PKCS#11 engine as part of the label

See merge request isc-projects/bind9!2943

6 years agoRemove reference to prepending label with engine in manpage
Ondřej Surý [Mon, 10 Feb 2020 15:29:43 +0000 (07:29 -0800)] 
Remove reference to prepending label with engine in manpage

6 years agoCleanup support for specifying PKCS#11 engine as part of the label
Ondřej Surý [Wed, 22 Jan 2020 09:16:22 +0000 (10:16 +0100)] 
Cleanup support for specifying PKCS#11 engine as part of the label

The code for specifying OpenSSL PKCS#11 engine as part of the label
(e.g. -l "pkcs11:token=..." instead of -E pkcs11 -l "token=...")
was non-functional.  This commit just cleans the related code.

6 years agoMerge branch 'ondrej/null-the-destroyed-pointer-early' into 'master'
Ondřej Surý [Mon, 10 Feb 2020 05:23:38 +0000 (05:23 +0000)] 
Merge branch 'ondrej/null-the-destroyed-pointer-early' into 'master'

NULL the destroyed pointer early

See merge request isc-projects/bind9!3026

6 years agoClear the pointer to destroyed object early using the semantic patch
Ondřej Surý [Sat, 8 Feb 2020 12:37:54 +0000 (04:37 -0800)] 
Clear the pointer to destroyed object early using the semantic patch

Also disable the semantic patch as the code needs tweaks here and there because
some destroy functions might not destroy the object and return early if the
object is still in use.

6 years agoAdd semantic patch to NULL the destroyed pointer early
Ondřej Surý [Sat, 8 Feb 2020 12:31:51 +0000 (04:31 -0800)] 
Add semantic patch to NULL the destroyed pointer early

Our destroy functions usually look like this:

    void
    foo_destroy(foo_t **foop) {
        foo_t foo = *foop;
        ...destroy the contents of foo...
        *foop = NULL;
    }

nulling the pointer should be done as soon as possible which is
not always the case.  This commit adds simple semantic patch that
changes the example function to:

    void
    foo_destroy(foo_t **foop) {
        foo_t foo = *foop;
        *foop = NULL;
        ...destroy the contents of foo...
    }

6 years agoMerge branch '932-doc-query-error-logging' into 'master'
Evan Hunt [Sun, 9 Feb 2020 00:06:24 +0000 (00:06 +0000)] 
Merge branch '932-doc-query-error-logging' into 'master'

improve documentation of query logging

Closes #932

See merge request isc-projects/bind9!2976

6 years agoimprove documentation of query logging
Evan Hunt [Wed, 29 Jan 2020 23:24:43 +0000 (15:24 -0800)] 
improve documentation of query logging

6 years agoMerge branch 'michal/fix-the-pipelined-system-test-on-openbsd' into 'master'
Ondřej Surý [Sat, 8 Feb 2020 22:46:26 +0000 (22:46 +0000)] 
Merge branch 'michal/fix-the-pipelined-system-test-on-openbsd' into 'master'

Fix the "pipelined" system test on OpenBSD

See merge request isc-projects/bind9!3011

6 years agoFix the "pipelined" system test on OpenBSD
Michał Kępień [Thu, 6 Feb 2020 12:36:32 +0000 (13:36 +0100)] 
Fix the "pipelined" system test on OpenBSD

On OpenBSD, the bin/tests/system/pipelined/ans5/ans.py script does not
shut down when it is sent the SIGTERM signal.  What seems to be
happening is that starting the UDP listening thread somehow makes the
accept() calls in the script's main thread uninterruptible and thus the
SIGTERM signal sent to the main thread does not get processed until a
TCP connection is established with the script's TCP socket.  Work around
the issue by setting a timeout for operations performed on the script's
TCP socket, so that each accept() call in the main thread's infinite
loop returns after at most 1 second, allowing termination signals sent
to the script to be processed.

6 years agoMerge branch 'wpk/fix-atomics-usage' into 'master'
Ondřej Surý [Sat, 8 Feb 2020 21:46:37 +0000 (21:46 +0000)] 
Merge branch 'wpk/fix-atomics-usage' into 'master'

Fix atomics usage for mutexatomics

See merge request isc-projects/bind9!2967

6 years agoAdd mutexatomics system and unit test jobs
Witold Kręcicki [Tue, 28 Jan 2020 09:00:48 +0000 (10:00 +0100)] 
Add mutexatomics system and unit test jobs

6 years agoFix atomics usage for mutexatomics
Witold Kręcicki [Tue, 28 Jan 2020 08:43:55 +0000 (09:43 +0100)] 
Fix atomics usage for mutexatomics

6 years agoMerge branch 'ondrej/coccinelle-improvements' into 'master'
Ondřej Surý [Sat, 8 Feb 2020 11:47:42 +0000 (11:47 +0000)] 
Merge branch 'ondrej/coccinelle-improvements' into 'master'

Variaous little coccinelle improvements

See merge request isc-projects/bind9!3025

6 years agoFormatting issues found by local coccinelle run
Ondřej Surý [Sat, 8 Feb 2020 10:49:47 +0000 (02:49 -0800)] 
Formatting issues found by local coccinelle run

6 years agoReplace isc_mem_put()+isc_mem_detach() with isc_mem_putanddetach() in contrib/
Ondřej Surý [Sat, 8 Feb 2020 10:46:25 +0000 (02:46 -0800)] 
Replace isc_mem_put()+isc_mem_detach() with isc_mem_putanddetach() in contrib/

6 years agoRun the check-cocci on the whole tree, allow passing extra arguments
Ondřej Surý [Sat, 8 Feb 2020 10:33:58 +0000 (02:33 -0800)] 
Run the check-cocci on the whole tree, allow passing extra arguments

6 years agoRemove #include <config.h> from netmgr.h
Ondřej Surý [Sat, 8 Feb 2020 10:33:27 +0000 (02:33 -0800)] 
Remove #include <config.h> from netmgr.h

6 years agoMerge branch '1596-echo_ic-should-be-used-for-continuations' into 'master'
Mark Andrews [Fri, 7 Feb 2020 21:35:28 +0000 (21:35 +0000)] 
Merge branch '1596-echo_ic-should-be-used-for-continuations' into 'master'

Resolve "echo_ic should be used for continuations."

Closes #1596

See merge request isc-projects/bind9!2991

6 years agoindent failed: descriptions
Mark Andrews [Thu, 6 Feb 2020 03:18:15 +0000 (14:18 +1100)] 
indent failed: descriptions

6 years agoindent some test descriptions/continuation
Mark Andrews [Thu, 6 Feb 2020 03:16:30 +0000 (14:16 +1100)] 
indent some test descriptions/continuation

6 years agoremove space before 'failed'
Mark Andrews [Thu, 6 Feb 2020 03:13:02 +0000 (14:13 +1100)] 
remove space before 'failed'

6 years agoident continuation of test descriptions
Mark Andrews [Thu, 6 Feb 2020 03:12:31 +0000 (14:12 +1100)] 
ident continuation of test descriptions

6 years agoremove space from before 'failed'; count errors
Mark Andrews [Thu, 6 Feb 2020 03:10:15 +0000 (14:10 +1100)] 
remove space from before 'failed'; count errors

6 years agoMerge branch 'each-max-zone-ttl' into 'master'
Matthijs Mekking [Fri, 7 Feb 2020 19:28:41 +0000 (19:28 +0000)] 
Merge branch 'each-max-zone-ttl' into 'master'

dnssec-policy neater configuration

See merge request isc-projects/bind9!3006

6 years agoupdate CHANGES
Matthijs Mekking [Thu, 6 Feb 2020 16:59:14 +0000 (17:59 +0100)] 
update CHANGES

6 years agomake ISO8601 duration parsing case-insensitive for robustness
Evan Hunt [Thu, 6 Feb 2020 20:51:24 +0000 (12:51 -0800)] 
make ISO8601 duration parsing case-insensitive for robustness

6 years agovarious style cleanups
Evan Hunt [Thu, 6 Feb 2020 18:28:53 +0000 (10:28 -0800)] 
various style cleanups

6 years agoadd support for key algorithm mnemonics in dnssec-policy
Evan Hunt [Thu, 6 Feb 2020 20:13:20 +0000 (12:13 -0800)] 
add support for key algorithm mnemonics in dnssec-policy

6 years agoWarn if key lengths are out of range/predefined
Matthijs Mekking [Thu, 6 Feb 2020 16:43:54 +0000 (17:43 +0100)] 
Warn if key lengths are out of range/predefined

6 years agoMake key-directory optional
Matthijs Mekking [Thu, 6 Feb 2020 14:56:58 +0000 (15:56 +0100)] 
Make key-directory optional

The key-directory keyword actually does nothing right now but may
be useful in the future if we want to differentiate between key
directories or HSM keys, or if we want to speficy different
directories for different keys or policies.  Make it optional for
the time being.

6 years agoAllow for key lifetime unlimited
Matthijs Mekking [Thu, 6 Feb 2020 14:41:47 +0000 (15:41 +0100)] 
Allow for key lifetime unlimited

The keyword 'unlimited' can be used instead of PT0S which means the
same but is more comprehensible for users.

Also fix some redundant "none" parameters in the kasp test.

6 years agorename 'zone-max-ttl' to 'max-zone-ttl' for consistency
Evan Hunt [Thu, 6 Feb 2020 06:09:48 +0000 (22:09 -0800)] 
rename 'zone-max-ttl' to 'max-zone-ttl' for consistency

6 years agoMerge branch '1589-intermittent-kasp-failure-keyid-0' into 'master'
Matthijs Mekking [Fri, 7 Feb 2020 15:09:58 +0000 (15:09 +0000)] 
Merge branch '1589-intermittent-kasp-failure-keyid-0' into 'master'

kasp test: Fix key id 0000 lookup

Closes #1589

See merge request isc-projects/bind9!2968

6 years agowhitespace: line out settime calls nicely
Matthijs Mekking [Fri, 7 Feb 2020 09:55:25 +0000 (10:55 +0100)] 
whitespace: line out settime calls nicely

6 years agokasp test: Fix key id 0000 lookup
Matthijs Mekking [Tue, 28 Jan 2020 14:52:08 +0000 (15:52 +0100)] 
kasp test: Fix key id 0000 lookup

When checking keys we search for keys by key id. The kasp test used key id
0 as an indicator that a key was not yet found. Use "no" instead.

6 years agoMerge branch '1599-autosign-conversion-from-nsec3-to-nsec-can-take-more-than-2-second...
Mark Andrews [Fri, 7 Feb 2020 12:37:35 +0000 (12:37 +0000)] 
Merge branch '1599-autosign-conversion-from-nsec3-to-nsec-can-take-more-than-2-seconds' into 'master'

Resolve "autosign conversion from NSEC3 to NSEC can take more than 2 seconds."

Closes #1599

See merge request isc-projects/bind9!3000

6 years agowait a short while for no NSEC3PARAM
Mark Andrews [Wed, 5 Feb 2020 08:42:47 +0000 (19:42 +1100)] 
wait a short while for no NSEC3PARAM

6 years agoMerge branch 'wpk/disable-openssl-siphash' into 'master'
Witold Krecicki [Fri, 7 Feb 2020 12:15:51 +0000 (12:15 +0000)] 
Merge branch 'wpk/disable-openssl-siphash' into 'master'

Disable OpenSSL siphash.

See merge request isc-projects/bind9!2965

6 years agoDisable OpenSSL siphash.
Witold Kręcicki [Tue, 28 Jan 2020 07:46:52 +0000 (08:46 +0100)] 
Disable OpenSSL siphash.

Creation of EVP_MD_CTX and EVP_PKEY is quite expensive, until
we fix the code to reuse the context and key we'll use our own
implementation of siphash.

6 years agoMerge branch 'marka-coverity-dns-db-find' into 'master'
Mark Andrews [Fri, 7 Feb 2020 09:43:50 +0000 (09:43 +0000)] 
Merge branch 'marka-coverity-dns-db-find' into 'master'

Silence unchecked return reported by coverity.

See merge request isc-projects/bind9!3005

6 years agoSilence unchecked return of dns_db_find()
Mark Andrews [Thu, 6 Feb 2020 00:02:55 +0000 (11:02 +1100)] 
Silence unchecked return of dns_db_find()

190        dns_rdataset_init(&rdataset);
    3. Condition r == 0, taking true branch.
    4. Condition result, taking false branch.

CID 1452691 (#1 of 1): Unchecked return value (CHECKED_RETURN)
5. check_return: Calling dns_db_find without checking return
value (as is done elsewhere 39 out of 45 times).

191        check_assertion(dns_db_find(db1, dns_rootname, v2,
192                                    dns_rdatatype_soa, 0, 0, NULL,
193                                    name, &rdataset, NULL));

6 years agoFix indenting.
Mark Andrews [Thu, 6 Feb 2020 00:02:38 +0000 (11:02 +1100)] 
Fix indenting.

6 years agoCorrect logged function name.
Mark Andrews [Thu, 6 Feb 2020 00:02:17 +0000 (11:02 +1100)] 
Correct logged function name.

6 years agoMerge branch 'wpk/tuning-small' into 'master'
Witold Krecicki [Fri, 7 Feb 2020 08:56:39 +0000 (08:56 +0000)] 
Merge branch 'wpk/tuning-small' into 'master'

Set --with-tuning=large as a default, add --with-tuning=small.

See merge request isc-projects/bind9!2989

6 years agoCHANGES note, update README.md an manpage.
Witold Kręcicki [Fri, 7 Feb 2020 07:57:56 +0000 (08:57 +0100)] 
CHANGES note, update README.md an manpage.

6 years agoAllow --enable-pthread-rwlock even without developer mode
Witold Kręcicki [Fri, 7 Feb 2020 07:54:54 +0000 (08:54 +0100)] 
Allow --enable-pthread-rwlock even without developer mode

6 years agoSet --with-tuning=large as a default, add --with-tuning=small.
Witold Kręcicki [Mon, 3 Feb 2020 09:50:18 +0000 (10:50 +0100)] 
Set --with-tuning=large as a default, add --with-tuning=small.

6 years agoMerge branch 'michal/fix-the-dnssec-system-test-on-windows' into 'master'
Michał Kępień [Thu, 6 Feb 2020 14:20:53 +0000 (14:20 +0000)] 
Merge branch 'michal/fix-the-dnssec-system-test-on-windows' into 'master'

Fix the "dnssec" system test on Windows

See merge request isc-projects/bind9!3010

6 years agoFix the "dnssec" system test on Windows
Michał Kępień [Thu, 6 Feb 2020 14:17:38 +0000 (15:17 +0100)] 
Fix the "dnssec" system test on Windows

Make sure carriage return characters are stripped from awk input to
enable the "dnssec" system test to pass on Windows.

6 years agoMerge branch '1545-dnssec-policy-cdnskey-test' into 'master'
Matthijs Mekking [Thu, 6 Feb 2020 10:31:16 +0000 (10:31 +0000)] 
Merge branch '1545-dnssec-policy-cdnskey-test' into 'master'

Update kasp test with CDNSKEY checks

Closes #1545

See merge request isc-projects/bind9!2808

6 years agoUpdate kasp test with CDNSKEY checks
Matthijs Mekking [Mon, 6 Jan 2020 11:58:04 +0000 (12:58 +0100)] 
Update kasp test with CDNSKEY checks

Add checks to the kasp system test to verify CDNSKEY publication.
This test is not entirely complete, because when there is a CDNSKEY
available but there should not be one for KEY N, it is hard to tell
whether the existing CDNSKEY actually belongs to KEY N or another
key.

The check works if we expect a CDNSKEY although we cannot guarantee
that the CDNSKEY is correct: The test verifies existence, not
correctness of the record.

6 years agoMerge branch '1593-dnssec-policy-new-key-on-restart-bug' into 'master'
Matthijs Mekking [Thu, 6 Feb 2020 09:50:51 +0000 (09:50 +0000)] 
Merge branch '1593-dnssec-policy-new-key-on-restart-bug' into 'master'

Fix kasp bug new KSK on restart [#1593]

Closes #1593

See merge request isc-projects/bind9!3007

6 years agoAdd parentheses around return values
Matthijs Mekking [Thu, 6 Feb 2020 08:29:01 +0000 (09:29 +0100)] 
Add parentheses around return values

6 years agoFix kasp bug new KSK on restart [#1593]
Matthijs Mekking [Thu, 6 Feb 2020 07:57:13 +0000 (08:57 +0100)] 
Fix kasp bug new KSK on restart [#1593]

When you do a restart or reconfig of named, or rndc loadkeys, this
triggers the key manager to run.  The key manager will check if new
keys need to be created. If there is an active key, and key rollover
is scheduled far enough away, no new key needs to be created.

However, there was a bug that when you just start to sign your zone,
it takes a while before the KSK becomes an active key. An active KSK
has its DS submitted or published, but before the key manager allows
that, the DNSKEY needs to be omnipresent. If you restart named
or rndc loadkeys in quick succession when you just started to sign
your zone, new keys will be created because the KSK is not yet
considered active.

Fix is to check for introducing as well as active keys. These keys
all have in common that their goal is to become omnipresent.

6 years agoMerge branch '914-forwarders-port-documentation' into 'master'
Matthijs Mekking [Thu, 6 Feb 2020 09:00:55 +0000 (09:00 +0000)] 
Merge branch '914-forwarders-port-documentation' into 'master'

Document forwarders config port and dscp param

Closes #914

See merge request isc-projects/bind9!2869

6 years agoDocument forwarders config port and dscp param
Matthijs Mekking [Mon, 13 Jan 2020 09:42:21 +0000 (10:42 +0100)] 
Document forwarders config port and dscp param

6 years agoMerge branch 'mnowak/windows-raise-port-range' into 'master'
Michal Nowak [Wed, 5 Feb 2020 10:03:10 +0000 (10:03 +0000)] 
Merge branch 'mnowak/windows-raise-port-range' into 'master'

Windows: Prevent tools from clashing with named in system tests

Closes #1566

See merge request isc-projects/bind9!2998

6 years agoWindows: Prevent tools from clashing with named in system tests
Michal Nowak [Wed, 5 Feb 2020 10:03:09 +0000 (10:03 +0000)] 
Windows: Prevent tools from clashing with named in system tests

In system tests on Windows tool's local port can sometimes clash with
'named'. On Unix the system is poked for the minimal local port,
otherwise is set to 32768 as a sane minimum. For Windows we don't
poke but set a hardcoded limit; this change aligns the limit with
Unix and changes it to 32768.

6 years agoMerge branch 'marka-coverity-master' into 'master'
Mark Andrews [Wed, 5 Feb 2020 08:13:16 +0000 (08:13 +0000)] 
Merge branch 'marka-coverity-master' into 'master'

Address various minor issues identified by coverity on master

See merge request isc-projects/bind9!2999

6 years ago'dispatch' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:53:43 +0000 (16:53 +1100)] 
'dispatch' must be non NULL, remove test.

10067 cleanup:

CID 1452683 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking dispatch suggests that it
may be null, but it has already been dereferenced on all
paths leading to the check.

10068        if (dispatch != NULL)
10069                isc_mem_put(server->mctx, dispatch, sizeof(*dispatch));

6 years ago'dctx' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:51:01 +0000 (16:51 +1100)] 
'dctx' must be non NULL, remove test.

1549 cleanup:
1550        if (dctx->dbiter != NULL)
1551                dns_dbiterator_destroy(&dctx->dbiter);
1552        if (dctx->db != NULL)
1553                dns_db_detach(&dctx->db);

CID 1452686 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking dctx suggests that it may
be null, but it has already been dereferenced on all paths
leading to the check.

1554        if (dctx != NULL)
1555                isc_mem_put(mctx, dctx, sizeof(*dctx));

6 years ago'dir_list' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:49:09 +0000 (16:49 +1100)] 
'dir_list' must be non NULL, remove test.

707 complete_allnds:

CID 1452689 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking dir_list suggests that it
may be null, but it has already been dereferenced on all
paths leading to the check.

708        if (dir_list != NULL) {
709                /* clean up entries from list. */

6 years ago'lcfg' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:45:59 +0000 (16:45 +1100)] 
'lcfg' must be non NULL, remove test.

389        else

CID 1452695 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking lcfg suggests that it may
be null, but it has already been dereferenced on all paths
leading to the check.

390                if (lcfg != NULL)
391                        isc_logconfig_destroy(&lcfg);

6 years ago's' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:43:12 +0000 (16:43 +1100)] 
's' must be non NULL, remove test.

122 cleanup:

CID 1452696 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking s suggests that it may be
null, but it has already been dereferenced on all paths
leading to the check.

123        if (s != NULL)
124                isc_mem_free(mctx, s);

6 years ago'tql' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:41:03 +0000 (16:41 +1100)] 
'tql' must be non NULL, remove test.

255 flag_fail:
256        /* get rid of what was build of the query list */

CID 1452697 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking tql suggests that it may
be null, but it has already been dereferenced on all paths
leading to the check.

257        if (tql != NULL)
258                destroy_querylist(mctx, &tql);

6 years ago'closest' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:37:33 +0000 (16:37 +1100)] 
'closest' must be non NULL, remove test.

6412 cleanup:
6413        dns_rdataset_disassociate(&neg);
6414        dns_rdataset_disassociate(&negsig);

CID 1452700 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking closest suggests that it
may be null, but it has already been dereferenced on all
paths leading to the check.

6415        if (closest != NULL)
6416                free_noqname(mctx, &closest);

6 years agocleanup error handling.
Mark Andrews [Wed, 5 Feb 2020 05:35:15 +0000 (16:35 +1100)] 
cleanup error handling.

336 cleanup_mem:
337        /* cleanup memory */
338
339        /* free tmpPath memory */

CID 1452701 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking tmpPath suggests that it
may be null, but it has already been dereferenced on all
paths leading to the check.

340        if (tmpPath != NULL && result != ISC_R_SUCCESS)
341                isc_mem_free(named_g_mctx, tmpPath);
342
343        /* free tmpPath memory */
344        return (result);

6 years ago'stub' cannot be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:28:56 +0000 (16:28 +1100)] 
'stub' cannot be non NULL, remove test.

13429 cleanup:
13430        cancel_refresh(zone);

CID 1452702 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking stub suggests that it may
be null, but it has already been dereferenced on all paths
leading to the check.

13431        if (stub != NULL) {
13432                stub->magic = 0;

6 years ago'noqname' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:18:50 +0000 (16:18 +1100)] 
'noqname' must be non NULL, remove test.

6367cleanup:
6368        dns_rdataset_disassociate(&neg);
6369        dns_rdataset_disassociate(&negsig);

CID 1452704 (#1 of 1): Dereference before null check
(REVERSE_INULL) check_after_deref: Null-checking noqname
suggests that it may be null, but it has already been
dereferenced on all paths leading to the check.

6370        if (noqname != NULL)
6371                free_noqname(mctx, &noqname);

6 years ago'dctx' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:15:35 +0000 (16:15 +1100)] 
'dctx' must be non NULL, remove test.

11030 cleanup:

CID 1452705 (#1 of 1): Dereference before null check
(REVERSE_INULL) check_after_deref: Null-checking dctx
suggests that it may be null, but it has already been
dereferenced on all paths leading to the check.

11031        if (dctx != NULL)
11032                dumpcontext_destroy(dctx);
11033        return (result);

6 years ago'event' must be non NULL, remove test.
Mark Andrews [Wed, 5 Feb 2020 05:11:11 +0000 (16:11 +1100)] 
'event' must be non NULL, remove test.

1401        }

CID 1453455 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking event suggests that it may be null,
but it has already been dereferenced on all paths leading to the check.

1402        if (event != NULL)
1403                isc_event_free(ISC_EVENT_PTR(&event));

6 years agoremove dead cleanup code.
Mark Andrews [Wed, 5 Feb 2020 05:07:31 +0000 (16:07 +1100)] 
remove dead cleanup code.

13836        if (zone != NULL)
13837                dns_zone_detach(&zone);

      null: At condition dz != NULL, the value of dz must be NULL.
      dead_error_condition: The condition dz != NULL cannot be true.

13838        if (dz != NULL) {

CID 1453456 (#1 of 1): Logically dead code (DEADCODE)
dead_error_begin: Execution cannot reach this statement:
dns_zone_detach(&dz->zone);.

13839                dns_zone_detach(&dz->zone);
13840                isc_mem_put(named_g_mctx, dz, sizeof(*dz));
13841        }

6 years agokeymgr_keyrole couldn't emit "NOSIGN".
Mark Andrews [Wed, 5 Feb 2020 05:04:09 +0000 (16:04 +1100)] 
keymgr_keyrole couldn't emit "NOSIGN".

 92        } else {
 93                return ("ZSK");
 94        }

CID 1455900 (#1 of 1): Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: return "NOSIGN";.

 95        return ("NOSIGN");

6 years agoRemove dead error code.
Mark Andrews [Wed, 5 Feb 2020 05:00:50 +0000 (16:00 +1100)] 
Remove dead error code.

128        return (ISC_R_SUCCESS);
129

CID 1456146 (#1 of 1): Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached: {
   if (dst->labels[i] != N....

130        do {

6 years ago'indentctx' is always defined. Just use it.
Mark Andrews [Wed, 5 Feb 2020 04:55:08 +0000 (15:55 +1100)] 
'indentctx' is always defined.  Just use it.

402        ctx->serve_stale_ttl = 0;

notnull: At condition indentctx, the value of indentctx
cannot be NULL.  dead_error_condition: The condition indentctx
must be true.

CID 1456147 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach the expression
default_indent inside this statement: ctx->indent = (indentctx
? ....

403        ctx->indent = indentctx ? *indentctx : default_indent;

6 years agobreak was on wrong line.
Mark Andrews [Wed, 5 Feb 2020 04:50:29 +0000 (15:50 +1100)] 
break was on wrong line.

 959                break;

CID 1457872 (#1 of 1): Structurally dead code (UNREACHABLE)
unreachable: This code cannot be reached:
isc__nm_incstats(sock->mgr,....

 960                isc__nm_incstats(sock->mgr, sock->statsindex[STATID_ACTIVE]);
 961        default:

6 years agodstkey is no longer used
Mark Andrews [Wed, 5 Feb 2020 04:47:09 +0000 (15:47 +1100)] 
dstkey is no longer used

6 years ago'buffer' must be non-NULL as isc_buffer_allocate can no longer fail.
Mark Andrews [Wed, 5 Feb 2020 04:41:26 +0000 (15:41 +1100)] 
'buffer' must be non-NULL as isc_buffer_allocate can no longer fail.

1636 cleanup:

CID 1458130 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking buffer suggests that it may be
null, but it has already been dereferenced on all paths leading to
the check.

1637        if (buffer != NULL)
1638                isc_buffer_free(&buffer);

6 years agoMerge branch 'ondrej/lgtm-narrow-vs-wider-type-comparison-in-a-loop' into 'master'
Ondřej Surý [Wed, 5 Feb 2020 05:12:01 +0000 (05:12 +0000)] 
Merge branch 'ondrej/lgtm-narrow-vs-wider-type-comparison-in-a-loop' into 'master'

Fix comparison between type uint16_t and  wider type size_t in a loop

See merge request isc-projects/bind9!2986

6 years agoFix comparison between type uint16_t and wider type size_t in a loop
Ondřej Surý [Sat, 1 Feb 2020 16:13:45 +0000 (17:13 +0100)] 
Fix comparison between type uint16_t and  wider type size_t in a loop

Found by LGTM.com (see below for description), and while it should not
happen as EDNS OPT RDLEN is uint16_t, the fix is easy.  A little bit
of cleanup is included too.

> In a loop condition, comparison of a value of a narrow type with a value
> of a wide type may result in unexpected behavior if the wider value is
> sufficiently large (or small). This is because the narrower value may
> overflow. This can lead to an infinite loop.