2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00
Commit Graph

33814 Commits

Author SHA1 Message Date
Diego Fronza
0ad6f594f6 Added option for disabling stale-answer-client-timeout
This commit allows to specify "disabled" or "off" in
stale-answer-client-timeout statement. The logic to support this
behavior will be added in the subsequent commits.

This commit also ensures an upper bound to stale-answer-client-timeout
which equals to one second less than 'resolver-query-timeout'.
2021-01-25 10:47:14 -03:00
Diego Fronza
a12bf4b61b Adjusted serve-stale test
After the addition of stale-answer-client-timeout a test was broken due
to the following behavior expected by the test.

1. Prime cache data.example txt.
2. Disable authoritative server.
3. Send a query for data.example txt.
4. Recursive server will timeout and answer from cache with stale RRset.
5. Recursive server will activate stale-refresh-time due to the previous
   failure in attempting to refresh the RRset.
6. Send a query for data.example txt.
7. Expect stale answer from cache due to stale-refresh-time
window being active, even if authoritative server is up.

Problem is that in step 4, due to the new option
stale-answer-client-timeout, recursive server will answer with stale
data before the actual fetch completes.

Since the original fetch is still running in background, if we re-enable
the authoritative server during that time, the RRset will actually be
successfully refreshed, and stale-refresh-window will not be activated.

The next queries will fail because they expect the TTL of the RRset to
match the one in the stale cache, not the one just refreshed.

To solve this, we explicitly disable stale-answer-client-timeout for
this test, as it's not the feature we are interested in testing here
anyways.
2021-01-25 10:47:14 -03:00
Diego Fronza
171a5b7542 Add stale-answer-client-timeout option
The general logic behind the addition of this new feature works as
folows:

When a client query arrives, the basic path (query.c / ns_query_recurse)
was to create a fetch, waiting for completion in fetch_callback.

With the introduction of stale-answer-client-timeout, a new event of
type DNS_EVENT_TRYSTALE may invoke fetch_callback, whenever stale
answers are enabled and the fetch took longer than
stale-answer-client-timeout to complete.

When an event of type DNS_EVENT_TRYSTALE triggers fetch_callback, we
must ensure that the folowing happens:

1. Setup a new query context with the sole purpose of looking up for
   stale RRset only data, for that matters a new flag was added
   'DNS_DBFIND_STALEONLY' used in database lookups.

    . If a stale RRset is found, mark the original client query as
      answered (with a new query attribute named NS_QUERYATTR_ANSWERED),
      so when the fetch completion event is received later, we avoid
      answering the client twice.

    . If a stale RRset is not found, cleanup and wait for the normal
      fetch completion event.

2. In ns_query_done, we must change this part:
	/*
	 * If we're recursing then just return; the query will
	 * resume when recursion ends.
	 */
	if (RECURSING(qctx->client)) {
		return (qctx->result);
	}

   To this:

	if (RECURSING(qctx->client) && !QUERY_STALEONLY(qctx->client)) {
		return (qctx->result);
	}

   Otherwise we would not proceed to answer the client if it happened
   that a stale answer was found when looking up for stale only data.

When an event of type DNS_EVENT_FETCHDONE triggers fetch_callback, we
proceed as before, resuming query, updating stats, etc, but a few
exceptions had to be added, most important of which are two:

1. Before answering the client (ns_client_send), check if the query
   wasn't already answered before.

2. Before detaching a client, e.g.
   isc_nmhandle_detach(&client->reqhandle), ensure that this is the
   fetch completion event, and not the one triggered due to
   stale-answer-client-timeout, so a correct call would be:
   if (!QUERY_STALEONLY(client)) {
        isc_nmhandle_detach(&client->reqhandle);
   }

Other than these notes, comments were added in code in attempt to make
these updates easier to follow.
2021-01-25 10:47:14 -03:00
Diego Fronza
74840ec50b Added dns_view_staleanswerenabled() function
Since it takes a couple lines of code to check whether stale answers
are enabled for a given view, code was extracted out to a proper
function.
2021-01-25 10:47:14 -03:00
Diego Fronza
49c40827f6 Avoid iterating name twice when constructing fctx->info
This is a minor performance improvement, we store the result of the
first call to strlcat to use as an offset in the next call when
constructing fctx->info string.
2021-01-25 10:47:14 -03:00
Michał Kępień
91acd207d2 Merge branch '2387-use--release-for-SONAME' into 'main'
Use -release instead of -version-info for internal library SONAMEs

Closes #2387

See merge request isc-projects/bind9!4552
2021-01-25 13:36:49 +00:00
Ondřej Surý
b30aaa3748 Add CHANGES and release note for GL #2387 2021-01-25 14:19:53 +01:00
Ondřej Surý
c605d75ea5 Use -release instead of -version-info for internal library SONAMEs
The BIND 9 libraries are considered to be internal only and hence the
API and ABI changes a lot.  Keeping track of the API/ABI changes takes
time and it's a complicated matter as the safest way to make everything
stable would be to bump any library in the dependency chain as in theory
if libns links with libdns, and a binary links with both, and we bump
the libdns SOVERSION, but not the libns SOVERSION, the old libns might
be loaded by binary pulling old libdns together with new libdns loaded
by the binary.  The situation gets even more complicated with loading
the plugins that have been compiled with few versions old BIND 9
libraries and then dynamically loaded into the named.

We are picking the safest option possible and usable for internal
libraries - instead of using -version-info that has only a weak link to
BIND 9 version number, we are using -release libtool option that will
embed the corresponding BIND 9 version number into the library name.

That means that instead of libisc.so.1701 (as an example) the library
will now be named libisc-9.17.10.so.
2021-01-25 14:19:53 +01:00
Michal Nowak
7939e7fd71 Merge branch '2415-update-coverity-scan-ci-job-to-2020-09' into 'main'
Update Coverity Scan CI job to 2020.09

Closes #2415

See merge request isc-projects/bind9!4593
2021-01-25 11:32:52 +00:00
Michal Nowak
7d428be79b Update Coverity Scan CI job to 2020.09 2021-01-25 12:31:11 +01:00
Ondřej Surý
5c27eef817 Merge branch '2335-tlsdns-refactoring' into 'main'
refactor TLSDNS module to work with libuv/ssl directly

Closes #2335

See merge request isc-projects/bind9!4584
2021-01-25 09:15:52 +00:00
Evan Hunt
f472390bc2 Add CHANGES note for #2335 2021-01-25 09:19:22 +01:00
Ondřej Surý
e493e04c0f Refactor TLSDNS module to work with libuv/ssl directly
* Following the example set in 634bdfb16d, the tlsdns netmgr
  module now uses libuv and SSL primitives directly, rather than
  opening a TLS socket which opens a TCP socket, as the previous
  model was difficult to debug.  Closes #2335.

* Remove the netmgr tls layer (we will have to re-add it for DoH)

* Add isc_tls API to wrap the OpenSSL SSL_CTX object into libisc
  library; move the OpenSSL initialization/deinitialization from dstapi
  needed for OpenSSL 1.0.x to the isc_tls_{initialize,destroy}()

* Add couple of new shims needed for OpenSSL 1.0.x

* When LibreSSL is used, require at least version 2.7.0 that
  has the best OpenSSL 1.1.x compatibility and auto init/deinit

* Enforce OpenSSL 1.1.x usage on Windows

* Added a TLSDNS unit test and implemented a simple TLSDNS echo
  server and client.
2021-01-25 09:19:22 +01:00
Michał Kępień
8f73c70d23 Merge branch 'v9_17_9-release' into 'main'
Merge 9.17.9 release branch

See merge request isc-projects/bind9!4586
2021-01-21 08:05:29 +00:00
Michał Kępień
7751a8eaf6 Set up release notes for BIND 9.17.10 2021-01-21 09:02:04 +01:00
Michał Kępień
f28804cd98 Bump BIND_BASELINE_VERSION for ABI checks 2021-01-21 09:02:04 +01:00
Michał Kępień
60b3c67cf0 Update GitLab issue number for CHANGES entry 5557 2021-01-21 08:57:22 +01:00
Michał Kępień
49d2aafdc4 Update BIND version to 9.17.9 2021-01-21 08:57:22 +01:00
Michał Kępień
cacf290ad2 Add a CHANGES marker 2021-01-21 08:57:22 +01:00
Michał Kępień
347d666b0f Update library API versions 2021-01-21 08:57:22 +01:00
Michał Kępień
5eac635fc0 Merge branch 'michal/prepare-documentation-for-bind-9.17.9' into 'v9_17_9-release'
Prepare documentation for BIND 9.17.9

See merge request isc-private/bind9!230
2021-01-21 08:57:22 +01:00
Michał Kępień
6118f75c70 Prepare release notes for BIND 9.17.9 2021-01-21 08:57:22 +01:00
Michał Kępień
cf9d818be3 Add release note for GL #2091 2021-01-21 08:57:22 +01:00
Michał Kępień
09ff03bb1c Reorder release notes 2021-01-21 08:57:22 +01:00
Michał Kępień
e343aa5b94 Tweak and reword release notes 2021-01-21 08:57:22 +01:00
Michał Kępień
598a026cae Tweak and reword recent CHANGES entries 2021-01-21 08:57:22 +01:00
Michał Kępień
b2b451d0bf Fix location of the CHANGES marker for BIND 9.17.8 2021-01-21 08:57:22 +01:00
Evan Hunt
9ec5dcf79c Merge branch 'each-fix-cpu-test' into 'main'
check whether taskset works before running cpu test

See merge request isc-projects/bind9!4583
2021-01-20 23:42:55 +00:00
Evan Hunt
a8a49bb783 check whether taskset works before running cpu test
the taskset command used for the cpu system test seems
to be failing under vmware, causing a test failure. we
can try the taskset command and skip the test if it doesn't
work.
2021-01-20 13:37:52 -08:00
Michal Nowak
56616c783b Merge branch 'mnowak/drop-issue-1941-workaround' into 'main'
Drop #1941 workaround

See merge request isc-projects/bind9!4580
2021-01-19 10:46:31 +00:00
Michal Nowak
fe5978f5ba Drop #1941 workaround
Workaround for issue #1941 is not needed anymore as the underlying
performance issue which manifested on FreeBSD was addressed.
2021-01-19 11:45:10 +01:00
Matthijs Mekking
0d6347b55e Merge branch '1086-cleanup-config-option-flags' into 'main'
Resolve "Reduce the number of "bad configuration options" flags"

Closes #1086

See merge request isc-projects/bind9!4476
2021-01-19 09:59:03 +00:00
Matthijs Mekking
f411f510f7 Remove the option 'filter-aaaa' options
The 'filter-aaaa', 'filter-aaaa-on-v4', and 'filter-aaaa-on-v6' options
are replaced by the filter-aaaa plugin. This plugin was introduced in
9.13.5 and so it is safe to remove the named.conf options.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
437d271483 Special case tests for lmdb
When compiling BIND 9 without lmdb, this is promoted from
'not operational' to 'not configured', resulting in a failure (and no
longer a warning) if ldmb-related configuration options are set.

Special case certain system tests to avoid test failures on systems
that do not have lmdb.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
dc6de216af Update copyrights for [#1086] 2021-01-19 10:12:40 +01:00
Matthijs Mekking
9d96350f4f Add notes for [#1086]
Mention the configuration cleanup.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
c6c3e2d074 Update doc files
Run make doc after all the code changes related to #1086.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
87744f218d Remove a lot of obsoleted options
These options were ancient or made obsolete a long time ago, it is
safe to remove them.

Also stop printing ancient options, they should be treated the same as
unknown options.

Removed options: lwres, geoip-use-ecs, sit-secret, use-ixfr,
acache-cleaning-interval, acache-enable, additional-from-auth,
additional-from-cache, allow-v6-synthesis, dnssec-enable,
max-acache-size, nosit-udp-size, queryport-pool-ports,
queryport-pool-updateinterval, request-sit, use-queryport-pool, and
support-ixfr.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
df435fc7da Remove the option 'dnssec-lookaside'
Obsoleted in 9.15, we can remove the option in 9.17.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
a889ed38ef Remove the option 'cleaning-interval'
Obsoleted in 9.15, we can remove the option in 9.17.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
6e2597b55a Log experimental options
Log a warning for the 'experimental' clause flag similar to
the 'deprecated' flag.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
d5f70b2237 Obsolete CLAUSEFLAG NEWDEFAULT
The 'new default' option was introduced in 2002 to signal that a
default option had changed its default value, in this specific case
the value for 'auth-nxdomain'. However, this default has been unchanged
for 18 years now, and logging that the default has changed does not
have significant value nowadays.

This is also a good example that the clause flag 'new default' is
broken: it is easy to get out of date.

It is also easy to forget, because we have changed the default value
for 'max-stale-ttl' and haven't been flagging it with 'new default'

Also, if the operator cares for a specific value it should set it
explicitly. Using the default is telling the software: use whatever
you think is best, and this may change over time. Default value
changes should be mentioned in the release note, but do not require
further special treatment.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
dda3a68efc Obsolete CLAUSEFLAG NOOP
The clause flag 'not operational' is promoted to 'not configured'.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
ff1957e95b Obsolete CLAUSEFLAG NOTIMP and NYI
The clause flags 'not implented' and 'not implemented yet' are the
same as 'obsoleted' when it comes to behavior. These options will
now be treated similar as obsoleted (the idea being that if an
option is implemented it should be functional).

The new options for DoT are new options and rather than flagging them
obsolete, they should have been flagged as experimental, signalling
that these options are subject to change in the future.
2021-01-19 10:12:40 +01:00
Matthijs Mekking
ef28737af8 Merge branch '2380-doc-engine-pkcs11' into 'main'
Resolve "Documentation  update - use of "-E pkcs11""

Closes #2380

See merge request isc-projects/bind9!4572
2021-01-19 09:10:32 +00:00
Matthijs Mekking
a9828dd170 Update documentation on -E option
The -E option does not default to pkcs11 if --with-pkcs11 is set,
but always needs to be set explicitly.
2021-01-19 09:05:28 +01:00
Michał Kępień
a23c5d2921 Merge branch 'michal/improve-danger-checks' into 'main'
Improve Danger checks

Closes #1923 and #1917

See merge request isc-projects/bind9!4503
2021-01-18 14:12:42 +00:00
Michał Kępień
bc42690c99 Skip subject line length check for merge commits
Some merge requests (e.g. those created for release branches) include
merge commits.  Prevent Danger from warning about excessive subject line
length for merge commits.  (While the proper way to detect a merge
commit would be to check the 'parents' attribute of a commit object,
Danger Python does not seem to populate that attribute, so a simple
string search is performed on the commit subject instead.)
2021-01-18 14:57:47 +01:00
Michał Kępień
09964e8085 Skip length check for lines containing references
The Danger GitLab CI job currently flags excessively long lines in
commit log messages.  Exclude lines containing references (i.e. starting
with "[1]", "[2]", etc.) from this check.  This allows e.g. long URLs to
be included in commit log messages without triggering Danger warnings.
2021-01-18 14:57:47 +01:00
Michał Kępień
801d13f62f Only warn about fixup commits once per run
The Danger GitLab CI job currently generates a separate error message
about fixup commits being present in a merge request for every such
commit found.  Prevent that by making it only log that error message
once per run.
2021-01-18 14:57:47 +01:00