]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 years agoMerge branch '1313-master-failing-to-build-on-macos-high-sierra' into 'master'
Ondřej Surý [Sat, 16 Nov 2019 05:22:05 +0000 (05:22 +0000)] 
Merge branch '1313-master-failing-to-build-on-macos-high-sierra' into 'master'

Resolve "master failing to build on MacOS High Sierra"

Closes #1313

See merge request isc-projects/bind9!2562

6 years agoconditionally test based on USE_LIBTOOL or LD_WRAP
Mark Andrews [Wed, 13 Nov 2019 23:00:36 +0000 (10:00 +1100)] 
conditionally test based on USE_LIBTOOL or LD_WRAP

6 years agospecify the install name when building libwrap
Mark Andrews [Wed, 13 Nov 2019 02:15:48 +0000 (13:15 +1100)] 
specify the install name when building libwrap

6 years agoMacOS portability
Mark Andrews [Tue, 12 Nov 2019 05:24:49 +0000 (16:24 +1100)] 
MacOS portability

-Wl,-z,interpose is not supported.
-Wl,rpath=<path> is not supported use -Wl,rpath,<path> instead.
Use @SO@ for loadable extension.
Use -L <path> -l libwrap instead of libwrap.sa.

6 years agoMerge branch '622-ds-anchor' into 'master'
Evan Hunt [Sat, 16 Nov 2019 02:32:12 +0000 (02:32 +0000)] 
Merge branch '622-ds-anchor' into 'master'

support "initial-ds" in managed-keys

Closes #622

See merge request isc-projects/bind9!1762

6 years agoCHANGES, release notes
Evan Hunt [Thu, 19 Sep 2019 22:02:42 +0000 (15:02 -0700)] 
CHANGES, release notes

6 years agoDocument initial-ds and static-ds keywords
Evan Hunt [Thu, 19 Sep 2019 21:52:49 +0000 (14:52 -0700)] 
Document initial-ds and static-ds keywords

6 years agouse DS style trust anchors in all system tests
Evan Hunt [Thu, 19 Sep 2019 02:41:40 +0000 (19:41 -0700)] 
use DS style trust anchors in all system tests

this adds functions in conf.sh.common to create DS-style trust anchor
files. those functions are then used to create nearly all of the trust
anchors in the system tests.

there are a few exceptions:
 - some tests in dnssec and mkeys rely on detection of unsupported
   algorithms, which only works with key-style trust anchors, so those
   are used for those tests in particular.
 - the mirror test had a problem with the use of a CSK without a
   SEP bit, which still needs addressing

in the future, some of these tests should be changed back to using
traditional trust anchors, so that both types will be exercised going
forward.

6 years agoadd support for DS trust anchors in delv
Evan Hunt [Thu, 19 Sep 2019 02:45:20 +0000 (19:45 -0700)] 
add support for DS trust anchors in delv

6 years agofix root key sentinel code to send the correct key ID for DS trust anchors
Evan Hunt [Wed, 18 Sep 2019 20:04:07 +0000 (13:04 -0700)] 
fix root key sentinel code to send the correct key ID for DS trust anchors

6 years agoadd validator support for static DS-style trust anchors
Evan Hunt [Wed, 18 Sep 2019 17:03:19 +0000 (10:03 -0700)] 
add validator support for static DS-style trust anchors

6 years agorefactor create_keydata
Evan Hunt [Wed, 18 Sep 2019 03:19:59 +0000 (20:19 -0700)] 
refactor create_keydata

use empty placeholder KEYDATA records for all trust anchors, not just
DS-style trust anchors.

this revealed a pre-existing bug: keyfetch_done() skips keys without
the SEP bit when populating the managed-keys zone. consequently, if a
zone only has a single ZSK which is configured as trust anchor and no
KSKs, then no KEYDATA record is ever written to the managed-keys zone
when keys are refreshed.

that was how the root server in the dnssec system test was configured.
however, previously, the KEYDATA was created when the key was
initialized; this prevented us from noticing the bug until now.

configuring a ZSK as an RFC 5011 trust anchor is not forbidden by the
spec, but it is highly unusual and not well defined.  so for the time
being, I have modified the system test to generate both a KSK and ZSK
for the root zone, enabling the test to pass.

we should consider adding code to detect this condition and allow keys
without the SEP bit to be used as trust anchors if no key with the SEP
bit is available, or at minimum, log a warning.

6 years agouse DS-style trust anchor to verify 5011 key refresh query
Evan Hunt [Tue, 17 Sep 2019 16:09:41 +0000 (09:09 -0700)] 
use DS-style trust anchor to verify 5011 key refresh query

note: this also needs further refactoring.

- when initializing RFC 5011 for a name, we populate the managed-keys
  zone with KEYDATA records derived from the initial-key trust anchors.

  however, with initial-ds trust anchors, there is no key. but the
  managed-keys zone still must have a KEYDATA record for the name,
  otherwise zone_refreshkeys() won't refresh that key. so, for
  initial-ds trust anchors, we now add an empty KEYDATA record and set
  the key refresh timer so that the real keys will be looked up as soon
  as possible.

- when a key refresh query is done, we verify it against the
  trust anchor; this is done in two ways, one with the DS RRset
  set up during configuration if present, or with the keys linked
  from each keynode in the list if not.  because there are two different
  verification methods, the loop structure is overly complex and should
  be simplified.

- the keyfetch_done() and sync_keyzone() functions are both too long
  and should be broken into smaller functions.

6 years agoallow DS trust anchors to be set in keytable
Evan Hunt [Tue, 17 Sep 2019 04:06:23 +0000 (21:06 -0700)] 
allow DS trust anchors to be set in keytable

note: this is a frankensteinian kluge which needs further refactoring.

the keytable started as an RBT where the node->data points to a list of
dns_keynode structures, each of which points to a single dst_key.
later it was modified so that the list could instead point to a single
"null" keynode structure, which does not reference a key; this means
a trust anchor has been configured but the RFC 5011 refresh failed.

in this branch it is further updated to allow the first keynode in
the list to point to an rdatalist of DS-style trust anchors.  these will
be used by the validator to populate 'val->dsset' when validating a zone
key.

a DS style trust anchor can be updated as a result of RFC 5011
processing to contain DST keys instead; this results in the DS list
being freed.  the reverse is not possible; attempting to add a DS-style
trust anchor if a key-style trust anchor is already in place results
in an error.

later, this should be refactored to use rdatalists for both DS-style
and key-style trust anchors, but we're keeping the existing code for
old-style trust anchors for now.

6 years agodisallow use of DS- and key-style trust anchors for the same name
Evan Hunt [Mon, 16 Sep 2019 20:56:31 +0000 (13:56 -0700)] 
disallow use of DS- and key-style trust anchors for the same name

6 years agoread DS trust anchors in named.conf
Evan Hunt [Mon, 16 Sep 2019 06:14:51 +0000 (23:14 -0700)] 
read DS trust anchors in named.conf

(but they aren't used for anything yet)

6 years agoadd "static-ds" and "initial-ds" keywords to config parser
Evan Hunt [Mon, 16 Sep 2019 05:15:29 +0000 (22:15 -0700)] 
add "static-ds" and "initial-ds" keywords to config parser

6 years agoadd a global function to match a DS rdata to a DNSKEY
Evan Hunt [Tue, 17 Sep 2019 14:19:32 +0000 (07:19 -0700)] 
add a global function to match a DS rdata to a DNSKEY

6 years agoMerge branch '622-validator-refactoring' into 'master'
Evan Hunt [Fri, 15 Nov 2019 23:46:36 +0000 (23:46 +0000)] 
Merge branch '622-validator-refactoring' into 'master'

preliminary validator refactoring

See merge request isc-projects/bind9!2346

6 years agoCHANGES, release note
Evan Hunt [Thu, 7 Nov 2019 05:23:07 +0000 (21:23 -0800)] 
CHANGES, release note

6 years agoremove unneeded members from dns_validator
Evan Hunt [Sun, 15 Sep 2019 23:36:16 +0000 (16:36 -0700)] 
remove unneeded members from dns_validator

- val->keynode and val->seensig were set but never used.
- val->nearest, val->soaset, val->soaname, val->nsecset and val->nsec3set
  were never used at all.

6 years agosimplify validate_dnskey and seek_ds
Evan Hunt [Tue, 10 Sep 2019 23:53:28 +0000 (16:53 -0700)] 
simplify validate_dnskey and seek_ds

- pull out the code that checks whether a key was signed by a trust
  anchor into a separate function, anchor_signed().
- pull out the code that looks up a DS while validating a zone key
  into a separate function, get_dsset().
- check in create_validator() whether the sigrdataset is bound, so that
  we can always pass in &val->fsigrdataset during an insecurity proof;
  this will allow a reduction of code duplication.

6 years agocontinue renaming functions for clarity
Evan Hunt [Fri, 16 Aug 2019 23:28:18 +0000 (16:28 -0700)] 
continue renaming functions for clarity

- also simplified some calls: don't pass siginfo where val->siginfo
  is sufficient, don't INSIST where returning false is sufficient.
- also added header comments to several local functions.

6 years agoconvert if to switch in get_key
Evan Hunt [Fri, 16 Aug 2019 23:27:50 +0000 (16:27 -0700)] 
convert if to switch in get_key

6 years agorename fetch/validator callback functions for consistency and clarity
Evan Hunt [Fri, 16 Aug 2019 19:28:22 +0000 (12:28 -0700)] 
rename fetch/validator callback functions for consistency and clarity

6 years agoreorder switch in validatezonekey to similar order as seek_ds
Evan Hunt [Thu, 8 Aug 2019 15:35:21 +0000 (08:35 -0700)] 
reorder switch in validatezonekey to similar order as seek_ds

6 years agoconvert if statement to switch
Evan Hunt [Thu, 8 Aug 2019 00:49:59 +0000 (17:49 -0700)] 
convert if statement to switch

6 years agorefactor dsfetched/dsfetched2 into a common function
Evan Hunt [Thu, 8 Aug 2019 00:26:35 +0000 (17:26 -0700)] 
refactor dsfetched/dsfetched2 into a common function

6 years agorename some functions for better clarity
Evan Hunt [Wed, 7 Aug 2019 23:54:05 +0000 (16:54 -0700)] 
rename some functions for better clarity

6 years agomove some duplicate code into validate_neg_rrset()
Evan Hunt [Wed, 7 Aug 2019 06:08:36 +0000 (23:08 -0700)] 
move some duplicate code into validate_neg_rrset()

6 years agomove the 'mustbesecure' checks into markanswer()
Evan Hunt [Tue, 6 Aug 2019 23:36:28 +0000 (16:36 -0700)] 
move the 'mustbesecure' checks into markanswer()

6 years agosplit proveunsecure()
Evan Hunt [Tue, 6 Aug 2019 23:11:22 +0000 (16:11 -0700)] 
split proveunsecure()

6 years agoreduce redundant code
Evan Hunt [Tue, 6 Aug 2019 20:13:38 +0000 (13:13 -0700)] 
reduce redundant code

6 years agostyle, braces, whitespace
Evan Hunt [Tue, 6 Aug 2019 20:44:30 +0000 (13:44 -0700)] 
style, braces, whitespace

6 years agoMerge branch '1323-reenable-lib-ns-unittests' into 'master'
Mark Andrews [Fri, 15 Nov 2019 05:50:14 +0000 (05:50 +0000)] 
Merge branch '1323-reenable-lib-ns-unittests' into 'master'

Properly disable lib/ns tests when run under ASAN

Closes #1323

See merge request isc-projects/bind9!2568

6 years agoProperly disable lib/ns tests when run under ASAN
Ondřej Surý [Wed, 13 Nov 2019 08:29:04 +0000 (09:29 +0100)] 
Properly disable lib/ns tests when run under ASAN

6 years agoMerge branch '1327-update-solution-dependencies-host-and-nslookup-depend-on-libirs...
Mark Andrews [Fri, 15 Nov 2019 01:09:16 +0000 (01:09 +0000)] 
Merge branch '1327-update-solution-dependencies-host-and-nslookup-depend-on-libirs' into 'master'

Resolve "Update solution dependencies: 'dig', 'host' and 'nslookup' depend on libirs."

Closes #1327

See merge request isc-projects/bind9!2573

6 years agoAdd dependancy on libirs to dig, host, and nslookup.
Mark Andrews [Fri, 15 Nov 2019 00:16:07 +0000 (11:16 +1100)] 
Add dependancy on libirs to dig, host, and nslookup.

6 years agoMerge branch 'ondrej/fix-timer-test' into 'master'
Ondřej Surý [Wed, 13 Nov 2019 14:29:49 +0000 (14:29 +0000)] 
Merge branch 'ondrej/fix-timer-test' into 'master'

Fix the crash in the timer test

See merge request isc-projects/bind9!2557

6 years agofix netmgr setup/teardown issues; setup and teardown only once in timer_test
Evan Hunt [Wed, 13 Nov 2019 07:13:49 +0000 (23:13 -0800)] 
fix netmgr setup/teardown issues; setup and teardown only once in timer_test

- the netmgr was not correctly being specified when creating the task
  manager, and was cleaned up in the wrong order when shutting down.
- on freebsd, timer_test appears to be prone to failure if the
  netmgr is set up and torn down before and after ever test case, but
  less so if it's only set up once at the beginning and once at the
  end.

6 years agoRemove the assertions from subthreads and use global errcnt to record errors
Ondřej Surý [Tue, 12 Nov 2019 11:15:10 +0000 (12:15 +0100)] 
Remove the assertions from subthreads and use global errcnt to record errors

6 years agoLock the lasttime variable that's concurrently accessed between threads
Ondřej Surý [Tue, 12 Nov 2019 10:50:11 +0000 (11:50 +0100)] 
Lock the lasttime variable that's concurrently accessed between threads

6 years agoDirectly embed ../timer.c in timer_test.c for better assertion testing
Ondřej Surý [Sat, 9 Nov 2019 13:01:25 +0000 (14:01 +0100)] 
Directly embed ../timer.c in timer_test.c for better assertion testing

6 years agoRefactor the way we use memory context from isctest.c
Ondřej Surý [Sat, 9 Nov 2019 13:01:08 +0000 (14:01 +0100)] 
Refactor the way we use memory context from isctest.c

This commit renames isctest {mctx,lctx} to test_{mctx,lctx} and cleans
up their usage in the individual unit tests.  This allows embedding
library .c files directly into the unit tests.

6 years agoMerge branch 'wpk/fix-accidental-task-unpause' into 'master'
Witold Krecicki [Wed, 13 Nov 2019 13:45:09 +0000 (13:45 +0000)] 
Merge branch 'wpk/fix-accidental-task-unpause' into 'master'

Fix implicit task unpause when going from 'running' to 'idle'.

See merge request isc-projects/bind9!2571

6 years agoIf a task is running and we call isc_task_pause it can
Witold Kręcicki [Wed, 13 Nov 2019 10:26:34 +0000 (11:26 +0100)] 
If a task is running and we call isc_task_pause it can
be implicitly unpaused when we switch from 'running' to
'idle' state. Fix it by not switching to 'idle' when paused.

6 years agoMerge branch 'fix-url-in-readme' into 'master'
Michał Kępień [Wed, 13 Nov 2019 11:59:11 +0000 (11:59 +0000)] 
Merge branch 'fix-url-in-readme' into 'master'

updated a broken link for newer release notes.

See merge request isc-projects/bind9!2567

6 years agoUpdate broken release notes link
Vicky Risk [Tue, 12 Nov 2019 22:17:56 +0000 (22:17 +0000)] 
Update broken release notes link

6 years agoMerge branch 'michal/fix-libuv.dll-handling' into 'master'
Michał Kępień [Tue, 12 Nov 2019 11:24:41 +0000 (11:24 +0000)] 
Merge branch 'michal/fix-libuv.dll-handling' into 'master'

Fix libuv.dll handling

See merge request isc-projects/bind9!2556

6 years agoFix libuv.dll handling
Michał Kępień [Fri, 8 Nov 2019 13:25:37 +0000 (14:25 +0100)] 
Fix libuv.dll handling

Make sure libuv.dll gets copied to the proper directory in the Release
build configuration and that the BIND installer on Windows installs
libuv.dll.

6 years agoMerge branch 'ondrej/cleanup-PATH_MAX-and-NAME_MAX-ifdefs' into 'master'
Ondřej Surý [Tue, 12 Nov 2019 09:13:25 +0000 (09:13 +0000)] 
Merge branch 'ondrej/cleanup-PATH_MAX-and-NAME_MAX-ifdefs' into 'master'

Cleanup the {PATH,NAME}_MAX stray #ifdefs

See merge request isc-projects/bind9!2565

6 years agoCleanup the {PATH,NAME}_MAX stray #ifdefs
Ondřej Surý [Tue, 12 Nov 2019 08:36:08 +0000 (09:36 +0100)] 
Cleanup the {PATH,NAME}_MAX stray #ifdefs

6 years agoMerge branch 'hurd' into 'master'
Ondřej Surý [Tue, 12 Nov 2019 08:09:03 +0000 (08:09 +0000)] 
Merge branch 'hurd' into 'master'

hurd: Fix build

See merge request isc-projects/bind9!2558

6 years agohurd: Fix build
Samuel Thibault [Sun, 10 Nov 2019 20:14:17 +0000 (20:14 +0000)] 
hurd: Fix build

Move PATH_MAX, NAME_MAX, IOV_MAX default definitions to the common
<isc/platform.h>.

6 years agoMerge branch '1134-add-missing-dnssec-keygen-dependency-on-libisccfg' into 'master'
Michał Kępień [Fri, 8 Nov 2019 12:42:50 +0000 (12:42 +0000)] 
Merge branch '1134-add-missing-dnssec-keygen-dependency-on-libisccfg' into 'master'

Add missing dnssec-keygen dependency on libisccfg

Closes #1134

See merge request isc-projects/bind9!2555

6 years agoAdd missing dnssec-keygen dependency on libisccfg
Michał Kępień [Fri, 8 Nov 2019 11:52:10 +0000 (12:52 +0100)] 
Add missing dnssec-keygen dependency on libisccfg

Commit 09ac224c5c881824c7b6649905f16b7d3f1036f4 made dnssec-keygen
depend on libisccfg but the Visual Studio solution file was not updated
to reflect that change.  Make sure the dnssec-keygen Visual Studio
project depends on the libisccfg project to prevent compilation issues
during parallel builds.

6 years agoMerge branch 'michal/split-release-notes-into-per-version-sections' into 'master'
Michał Kępień [Fri, 8 Nov 2019 11:16:02 +0000 (11:16 +0000)] 
Merge branch 'michal/split-release-notes-into-per-version-sections' into 'master'

Split release notes into per-version sections

See merge request isc-projects/bind9!2524

6 years agoRebuild output files
Michał Kępień [Tue, 5 Nov 2019 11:33:40 +0000 (12:33 +0100)] 
Rebuild output files

6 years agoUpdate URLs used in release notes
Michał Kępień [Tue, 5 Nov 2019 11:33:40 +0000 (12:33 +0100)] 
Update URLs used in release notes

Some URLs used in release notes became outdated.  Make sure they point
to currently available resources.

6 years agoSplit release notes into per-version sections
Michał Kępień [Tue, 5 Nov 2019 11:33:40 +0000 (12:33 +0100)] 
Split release notes into per-version sections

Intertwining release notes from different BIND releases in a single XML
file has caused confusion in the past due to different (and often
arbitrary) approaches to keeping/removing release notes from older
releases on different BIND branches.  Divide doc/arm/notes.xml into
per-version sections to simplify determining the set of changes
introduced by a given release and to make adding/reviewing release notes
less error-prone.

6 years agoMerge branch '1256-fix-the-jitter-test-2' into 'master'
Ondřej Surý [Fri, 8 Nov 2019 07:43:50 +0000 (07:43 +0000)] 
Merge branch '1256-fix-the-jitter-test-2' into 'master'

Wait a little bit longer for autosign, bail out on not enough categories

See merge request isc-projects/bind9!2554

6 years agoWait a little bit longer for autosign, bail out on not enough categories
Ondřej Surý [Fri, 8 Nov 2019 06:43:33 +0000 (07:43 +0100)] 
Wait a little bit longer for autosign, bail out on not enough categories

6 years agoAdjust the jitter range to +-3*stddev
Ondřej Surý [Fri, 8 Nov 2019 06:05:02 +0000 (07:05 +0100)] 
Adjust the jitter range to +-3*stddev

6 years agoMerge branch '1256-fix-the-jitter-test' into 'master'
Ondřej Surý [Fri, 8 Nov 2019 06:01:47 +0000 (06:01 +0000)] 
Merge branch '1256-fix-the-jitter-test' into 'master'

Check if the RRSIG jitter falls <mean-2.5*stddev;mean+2.5*stddev>

Closes #1309

See merge request isc-projects/bind9!2553

6 years agoRevert "temporarily disable jitter tests in the 'autosign' system test"
Ondřej Surý [Thu, 7 Nov 2019 20:42:45 +0000 (21:42 +0100)] 
Revert "temporarily disable jitter tests in the 'autosign' system test"

This reverts commit e17b7ee05aebeedbbbf8fc581eb9ae472a63e88a.

6 years agoCheck if the RRSIG jitter falls into mean+-2.5*stddev range
Ondřej Surý [Thu, 7 Nov 2019 13:54:24 +0000 (14:54 +0100)] 
Check if the RRSIG jitter falls into mean+-2.5*stddev range

6 years agoMerge branch '29-libuv-network-manager' into 'master'
Witold Krecicki [Thu, 7 Nov 2019 21:32:28 +0000 (21:32 +0000)] 
Merge branch '29-libuv-network-manager' into 'master'

libuv-based network manager

Closes #29

See merge request isc-projects/bind9!2528

6 years agoCHANGES, README, release note
Evan Hunt [Wed, 6 Nov 2019 01:52:03 +0000 (17:52 -0800)] 
CHANGES, README, release note

6 years agoadjust system tests to deal with possible timing issues
Evan Hunt [Wed, 6 Nov 2019 00:14:06 +0000 (16:14 -0800)] 
adjust system tests to deal with possible timing issues

With the netmgr in use, named may start answering queries before zones
are loaded. This can cause transient failures in system tests after
servers are restarted or reconfigured. This commit adds retry loops
and sleep statements where needed to address this problem.

Also incidentally silenced a clang warning.

6 years agoremove ISC_QUEUE as it is no longer used
Evan Hunt [Wed, 6 Nov 2019 00:39:58 +0000 (16:39 -0800)] 
remove ISC_QUEUE as it is no longer used

6 years agoconvert ns_client and related objects to use netmgr
Evan Hunt [Tue, 5 Nov 2019 23:34:35 +0000 (15:34 -0800)] 
convert ns_client and related objects to use netmgr

- ns__client_request() is now called by netmgr with an isc_nmhandle_t
  parameter. The handle can then be permanently associated with an
  ns_client object.
- The task manager is paused so that isc_task events that may be
  triggred during client processing will not fire until after the netmgr is
  finished with it. Before any asynchronous event, the client MUST
  call isc_nmhandle_ref(client->handle), to prevent the client from
  being reset and reused while waiting for an event to process. When
  the asynchronous event is complete, isc_nmhandle_unref(client->handle)
  must be called to ensure the handle can be reused later.
- reference counting of client objects is now handled in the nmhandle
  object.  when the handle references drop to zero, the client's "reset"
  callback is used to free temporary resources and reiniialize it,
  whereupon the handle (and associated client) is placed in the
  "inactive handles" queue.  when the sysstem is shutdown and the
  handles are cleaned up, the client's "put" callback is called to free
  all remaining resources.
- because client allocation is no longer handled in the same way,
  the '-T clienttest' option has now been removed and is no longer
  used by any system tests.
- the unit tests require wrapping the isc_nmhandle_unref() function;
  when LD_WRAP is supported, that is used. otherwise we link a
  libwrap.so interposer library and use that.

6 years agouse clock_gettime() instead of gettimeofday() for isc_itme functions
Witold Kręcicki [Sat, 8 Dec 2018 23:41:21 +0000 (00:41 +0100)] 
use clock_gettime() instead of gettimeofday() for isc_itme functions

6 years agoadd atomic_exchange operations to mutexatomic.h and win32 stdatomic.h
Witold Kręcicki [Thu, 24 Oct 2019 08:55:54 +0000 (10:55 +0200)] 
add atomic_exchange operations to mutexatomic.h and win32 stdatomic.h

6 years agoadd isc_task_pause() and isc_task_unpause() functions
Evan Hunt [Tue, 5 Nov 2019 23:23:33 +0000 (15:23 -0800)] 
add isc_task_pause() and isc_task_unpause() functions

This allows a task to be temporary disabled so that objects won't be
processed simultaneously by libuv events and isc_task events. When a
task is paused, currently running events may complete, but no further
event will added to the run queue will be executed until the task is
unpaused.

6 years agooptionally associate a netmgr with a task manager when creating
Evan Hunt [Tue, 5 Nov 2019 23:23:33 +0000 (15:23 -0800)] 
optionally associate a netmgr with a task manager when creating

When a task manager is created, we can now specify an `isc_nm`
object to associate with it; thereafter when the task manager is
placed into exclusive mode, the network manager will be paused.

6 years agodisable leak detection in ASAN; libuv has some problems with that
Witold Kręcicki [Mon, 4 Nov 2019 14:32:31 +0000 (15:32 +0100)] 
disable leak detection in ASAN; libuv has some problems with that

6 years agouse netmgr in libisc unit tests
Evan Hunt [Wed, 6 Nov 2019 00:28:43 +0000 (16:28 -0800)] 
use netmgr in libisc unit tests

6 years agonetmgr: libuv-based network manager
Witold Kręcicki [Tue, 5 Nov 2019 21:55:54 +0000 (13:55 -0800)] 
netmgr: libuv-based network manager

This is a replacement for the existing isc_socket and isc_socketmgr
implementation. It uses libuv for asynchronous network communication;
"networker" objects will be distributed across worker threads reading
incoming packets and sending them for processing.

UDP listener sockets automatically create an array of "child" sockets
so each worker can listen separately.

TCP sockets are shared amongst worker threads.

A TCPDNS socket is a wrapper around a TCP socket, which handles the
the two-byte length field at the beginning of DNS messages over TCP.

(Other wrapper socket types can be implemented in the future to handle
DNS over TLS, DNS over HTTPS, etc.)

6 years agoimplement fixed-size array stack data structure
Evan Hunt [Tue, 5 Nov 2019 21:50:43 +0000 (13:50 -0800)] 
implement fixed-size array stack data structure

6 years agoimplement fetch-and-add array queue data structure
Witold Kręcicki [Tue, 5 Nov 2019 21:28:50 +0000 (13:28 -0800)] 
implement fetch-and-add array queue data structure

this is a lockless queue based on hazard pointers.

6 years agotemporarily move ISC_QUEUE to list.h
Evan Hunt [Tue, 5 Nov 2019 21:18:37 +0000 (13:18 -0800)] 
temporarily move ISC_QUEUE to list.h

The double-locked queue implementation is still currently in use
in ns_client, but will be replaced by a fetch-and-add array queue.
This commit moves it from queue.h to list.h so that queue.h can be
used for the new data structure, and clean up dependencies between
list.h and types.h. Later, when the ISC_QUEUE is no longer is use,
it will be removed completely.

6 years agoimplement hazard pointer data structure
Witold Kręcicki [Tue, 5 Nov 2019 18:52:20 +0000 (10:52 -0800)] 
implement hazard pointer data structure

this is a mechanism to allow safe lock-free data structures.

6 years agoPreliminary netmgr design documentation
Witold Kręcicki [Wed, 8 May 2019 08:43:12 +0000 (10:43 +0200)] 
Preliminary netmgr design documentation

6 years agoadd isc_sockaddr_fromsockaddr function
Witold Kręcicki [Tue, 15 Jan 2019 10:01:13 +0000 (11:01 +0100)] 
add isc_sockaddr_fromsockaddr function

This converts from struct sockaddr to isc_sockaddr_t

6 years agoMerge branch '1308-fix-tcp-system-test' into 'master'
Evan Hunt [Thu, 7 Nov 2019 19:55:04 +0000 (19:55 +0000)] 
Merge branch '1308-fix-tcp-system-test' into 'master'

Fix "tcp" system test

Closes #1308

See merge request isc-projects/bind9!2549

6 years agomake send_command wait for any result, rather than specifically result=OK
Evan Hunt [Thu, 7 Nov 2019 19:32:59 +0000 (11:32 -0800)] 
make send_command wait for any result, rather than specifically result=OK

6 years agoAddress ShellCheck warnings
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Address ShellCheck warnings

Address all outstanding warnings that ShellCheck reports for
bin/tests/system/tcp/tests.sh.

6 years agoUse "set -e" in the "tcp" system test
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Use "set -e" in the "tcp" system test

Ensure any unexpected failure in the "tcp" system test causes it to be
immediately interrupted with an error to make the aforementioned test
more reliable.  Since the exit code for "expr 0 + 0" is 1, the status
variable needs to be updated using arithmetic expansion.

6 years agoEnsure all "tcp" system test errors are caught
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Ensure all "tcp" system test errors are caught

Ensure any "rndc stats" failure causes the "tcp" system test to fail.
Do not hide "rndc stats" output.

6 years agoMake all "tcp" system test checks numbered
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Make all "tcp" system test checks numbered

Ensure all checks in the "tcp" system test are numbered, so that
forensic data is preserved in case of any failure.

6 years agoFix argument order in assert_int_equal()
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Fix argument order in assert_int_equal()

assert_int_equal() calls in bin/tests/system/tcp/tests.sh pass the found
value as the first argument and the expected value as the second
argument, while the function interprets its arguments the other way
round.  Fix argument handling in assert_int_equal() to make sure the
error messages printed by that function are correct.

6 years agoAllow retries when checking TCP high-water stats
Michał Kępień [Thu, 7 Nov 2019 11:25:39 +0000 (12:25 +0100)] 
Allow retries when checking TCP high-water stats

In the TCP high-water checks, "rndc stats" is run after ans6 reports
that it opened the requested number of TCP connections.  However, we
fail to account for the fact that ns5 might not yet have called accept()
for these connections, in which case the counts output by "rndc stats"
will be off.  To prevent intermittent "tcp" system test failures, allow
the relevant connection count checks to be retried (just once, after one
second, as that should be enough for any system to accept() a dozen TCP
connections under any circumstances).

6 years agoMerge branch 'each-disable-jitter-test' into 'master'
Evan Hunt [Thu, 7 Nov 2019 18:25:36 +0000 (18:25 +0000)] 
Merge branch 'each-disable-jitter-test' into 'master'

temporarily disable jitter tests in the 'autosign' system test

See merge request isc-projects/bind9!2551

6 years agotemporarily disable jitter tests in the 'autosign' system test
Evan Hunt [Thu, 7 Nov 2019 17:09:28 +0000 (09:09 -0800)] 
temporarily disable jitter tests in the 'autosign' system test

the current method used for testing distribution of signatures
is failure-prone. we need to replace it with something both
effective and portable, but in the meantime we're commenting
out the jitter test.

6 years agoMerge branch '1134-fix-bashisms-in-kasp-test' into 'master'
Ondřej Surý [Thu, 7 Nov 2019 12:52:14 +0000 (12:52 +0000)] 
Merge branch '1134-fix-bashisms-in-kasp-test' into 'master'

Fix the bashisms in kasp/tests.sh and make the script shellcheck clean

See merge request isc-projects/bind9!2548

6 years agoUse better '\#' quoting in ns3/setup.sh
Ondřej Surý [Thu, 7 Nov 2019 11:04:38 +0000 (12:04 +0100)] 
Use better '\#' quoting in ns3/setup.sh

6 years agoRelax the requirement for check_next_key_event() to <-60;60>
Ondřej Surý [Thu, 7 Nov 2019 09:39:43 +0000 (10:39 +0100)] 
Relax the requirement for check_next_key_event() to <-60;60>

The original requirement for the check to pass was <-10;10> interval and
the first test was failing by 1 second.  As the minimum interval for
checking is 7200 seconds, the commit relaxes the requirement to <-60;60>
interval, which is still sane, but not that draconic.

6 years agoFix the get_keyids() usage as it could return multiple key ids
Ondřej Surý [Thu, 7 Nov 2019 09:26:04 +0000 (10:26 +0100)] 
Fix the get_keyids() usage as it could return multiple key ids

The get_keyids() function can return multiple keyids, when the
return value was not quoted, only the first keyid would be checked
with check_key() function.  This MR fixes both the error that came
with quoting the "$id" with value "12345 54321", and the code now
checks all returned keyids.

6 years agoClean the rest of the shellcheck errors
Ondřej Surý [Thu, 7 Nov 2019 09:07:14 +0000 (10:07 +0100)] 
Clean the rest of the shellcheck errors

6 years agoUse the shellcheck -f diff to autofix certain classes of sh errors
Ondřej Surý [Thu, 7 Nov 2019 08:52:16 +0000 (09:52 +0100)] 
Use the shellcheck -f diff to autofix certain classes of sh errors