]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
6 years agouse the full sig-validity-interval for RRSIG(SOA)
Mark Andrews [Tue, 25 Feb 2020 01:09:13 +0000 (12:09 +1100)] 
use the full sig-validity-interval for RRSIG(SOA)

6 years agoMerge branch 'marka-coverity-stop-taint' into 'master'
Mark Andrews [Thu, 27 Feb 2020 20:01:04 +0000 (20:01 +0000)] 
Merge branch 'marka-coverity-stop-taint' into 'master'

Simplify hash computation to prevent pointer being classed as tainted.

See merge request isc-projects/bind9!3081

6 years agoSimplify hash computation to prevent pointer being classed as tainted.
Mark Andrews [Mon, 17 Feb 2020 22:40:21 +0000 (09:40 +1100)] 
Simplify hash computation to prevent pointer being classed as tainted.

mem.c:add_trace_entry() -> isc_hash_function() -> isc_siphash24()

129        for (; in != end; in += 8) {

6. byte_swapping: Performing a byte swapping operation on
in implies that it came from an external source, and is
therefore tainted.

130                uint64_t m = U8TO64_LE(in);

6 years agoMerge branch 'wpk/perfwork-5-isc-result-rwlock' into 'master'
Witold Krecicki [Thu, 27 Feb 2020 09:48:11 +0000 (09:48 +0000)] 
Merge branch 'wpk/perfwork-5-isc-result-rwlock' into 'master'

Perfwork 5/6 - Use isc_rwlock for isc_result tables

See merge request isc-projects/bind9!3069

6 years agoUse isc_rwlock for isc_result tables
Witold Kręcicki [Tue, 28 Jan 2020 10:27:27 +0000 (11:27 +0100)] 
Use isc_rwlock for isc_result tables

6 years agoMerge branch 'each-speedup-serve-stale-test' into 'master'
Evan Hunt [Thu, 27 Feb 2020 06:57:56 +0000 (06:57 +0000)] 
Merge branch 'each-speedup-serve-stale-test' into 'master'

Speed up serve-stale test

See merge request isc-projects/bind9!3090

6 years agosend bursts of queries in parallel to reduce test runtime
Evan Hunt [Thu, 20 Feb 2020 02:26:48 +0000 (18:26 -0800)] 
send bursts of queries in parallel to reduce test runtime

sending each group of queries simultaneously, and then checking the
output after the last one finishes, reduces the runtime of the
serve-stale test by about six minutes.

6 years agostop testing 'serve-stale yes' and 'serve-fail no' alternate syntax
Evan Hunt [Wed, 19 Feb 2020 23:46:26 +0000 (15:46 -0800)] 
stop testing 'serve-stale yes' and 'serve-fail no' alternate syntax

"yes" and "no" are permissible synonyms for "on" and "off", which
use exactly the same code paths. making sure they work isn't a good
use of 80 seconds of test time.

6 years agouse "on|off" in rndc -h output to match the man page
Evan Hunt [Wed, 19 Feb 2020 23:40:50 +0000 (15:40 -0800)] 
use "on|off" in rndc -h output to match the man page

6 years agoMerge branch '1623-assertion-failure-ns-client-endrequest' into 'master'
Witold Krecicki [Wed, 26 Feb 2020 12:35:19 +0000 (12:35 +0000)] 
Merge branch '1623-assertion-failure-ns-client-endrequest' into 'master'

Don't issue ns_client_endrequest on a NS_CLIENTSTATE_READY client.

Closes #1623

See merge request isc-projects/bind9!3077

6 years agoDon't issue ns_client_endrequest on a NS_CLIENTSTATE_READY client.
Witold Kręcicki [Mon, 17 Feb 2020 14:52:09 +0000 (15:52 +0100)] 
Don't issue ns_client_endrequest on a NS_CLIENTSTATE_READY client.

Fix a potential assertion failure on shutdown in ns__client_endrequest.
Scenario:
1. We are shutting down, interface->clientmgr is gone.
2. We receive a packet, it gets through ns__client_request
3. mgr == NULL, return
4. isc_nmhandle_detach calls ns_client_reset_cb
5. ns_client_reset_cb calls ns_client_endrequest
6. INSIST(client->state == NS_CLIENTSTATE_WORKING ||
          client->state == NS_CLIENTSTATE_RECURSING) is not met
   - we haven't started processing this packet so
   client->state == NS_CLIENTSTATE_READY.
As a solution - don't do anything in ns_client_reset_cb if the client
is still in READY state.

6 years agoMerge branch 'wpk/perfwork-4-compressctx-arena' into 'master'
Witold Krecicki [Wed, 26 Feb 2020 08:17:28 +0000 (08:17 +0000)] 
Merge branch 'wpk/perfwork-4-compressctx-arena' into 'master'

Perfwork 4/6 - add an arena to compressctx

See merge request isc-projects/bind9!3068

6 years agoAdd an arena to compressctx
Witold Kręcicki [Mon, 3 Feb 2020 10:17:32 +0000 (11:17 +0100)] 
Add an arena to compressctx

6 years agoMerge branch 'each-cosmetic-fixes' into 'master'
Evan Hunt [Tue, 25 Feb 2020 19:05:53 +0000 (19:05 +0000)] 
Merge branch 'each-cosmetic-fixes' into 'master'

minor cosmetic fixes

See merge request isc-projects/bind9!3085

6 years agominor cosmetic fixes
Evan Hunt [Wed, 19 Feb 2020 08:17:03 +0000 (00:17 -0800)] 
minor cosmetic fixes

- the configuration summary reported zlib compression was not
  supported even when it was.
- when bind.keys.h was regenerated it violated clang-format style.

6 years agoMerge branch '103-include-multiple-files' into 'master'
Matthijs Mekking [Tue, 25 Feb 2020 12:17:33 +0000 (12:17 +0000)] 
Merge branch '103-include-multiple-files' into 'master'

Resolve "[RT#43439 'include' a whole directory when creating BIND zone file"

Closes #103

See merge request isc-projects/bind9!2296

6 years agoMake clang-format happy
Matthijs Mekking [Tue, 25 Feb 2020 08:07:45 +0000 (09:07 +0100)] 
Make clang-format happy

6 years agoUpdate copyrights
Diego Fronza [Mon, 24 Feb 2020 16:53:32 +0000 (13:53 -0300)] 
Update copyrights

6 years agoAdd test for checkconf glob include
Matthijs Mekking [Mon, 10 Feb 2020 10:24:28 +0000 (11:24 +0100)] 
Add test for checkconf glob include

6 years agoUpdate configure to handle glob.h
Diego Fronza [Thu, 30 Jan 2020 17:39:30 +0000 (14:39 -0300)] 
Update configure to handle glob.h

6 years agoAdded a isc_glob() function that wraps glob() calls for POSIX systems
Diego Fronza [Wed, 23 Oct 2019 19:25:06 +0000 (16:25 -0300)] 
Added a isc_glob() function that wraps glob() calls for POSIX systems
and implement a custom glob() function on Windows systems.

6 years agoAdded test to verify that both include glob-expression and include
Diego Fronza [Tue, 22 Oct 2019 13:43:24 +0000 (10:43 -0300)] 
Added test to verify that both include glob-expression and include
non-glob-expression works.

6 years agoAdded tests for include directive + glob expressions.
Diego dos Santos Fronza [Mon, 16 Sep 2019 15:03:10 +0000 (12:03 -0300)] 
Added tests for include directive + glob expressions.

6 years agoAllowing include directive to use glob expressions, e.g. include
Diego dos Santos Fronza [Fri, 13 Sep 2019 15:08:56 +0000 (12:08 -0300)] 
Allowing include directive to use glob expressions, e.g. include
"/opt/named.conf/*.conf".

6 years agoMerge branch 'michal/misc-9.17-preparations' into 'master'
Michał Kępień [Mon, 24 Feb 2020 10:03:07 +0000 (10:03 +0000)] 
Merge branch 'michal/misc-9.17-preparations' into 'master'

Miscellaneous BIND 9.17 preparations

See merge request isc-projects/bind9!3108

6 years agoRebuild documentation
Evan Hunt [Mon, 24 Feb 2020 04:48:55 +0000 (20:48 -0800)] 
Rebuild documentation

6 years agoBump version to 9.17.0
Michał Kępień [Mon, 24 Feb 2020 09:56:47 +0000 (10:56 +0100)] 
Bump version to 9.17.0

6 years agoBump library API versions for BIND 9.17
Michał Kępień [Mon, 24 Feb 2020 09:56:47 +0000 (10:56 +0100)] 
Bump library API versions for BIND 9.17

6 years agoAdd libuv information to win32utils/build.txt
Michał Kępień [Mon, 24 Feb 2020 09:56:47 +0000 (10:56 +0100)] 
Add libuv information to win32utils/build.txt

6 years agoFix broken link in configure.ac
Michał Kępień [Mon, 24 Feb 2020 09:56:47 +0000 (10:56 +0100)] 
Fix broken link in configure.ac

6 years agoUpdate PLATFORMS for BIND 9.17
Michał Kępień [Mon, 24 Feb 2020 09:56:47 +0000 (10:56 +0100)] 
Update PLATFORMS for BIND 9.17

6 years agoUpdate README and HISTORY for BIND 9.17
Michał Kępień [Mon, 24 Feb 2020 09:56:47 +0000 (10:56 +0100)] 
Update README and HISTORY for BIND 9.17

6 years agoUpdate release notes for BIND 9.17.0
Michał Kępień [Mon, 24 Feb 2020 09:56:47 +0000 (10:56 +0100)] 
Update release notes for BIND 9.17.0

6 years agoMerge branch '1632-spelling-take2' into 'master'
Evan Hunt [Fri, 21 Feb 2020 22:14:32 +0000 (22:14 +0000)] 
Merge branch '1632-spelling-take2' into 'master'

some Fossies-reported spelling errors were accidentally left unfixed

Closes #1632

See merge request isc-projects/bind9!3110

6 years agosome Fossies-reported spelling errors were accidentally left unfixed
Evan Hunt [Fri, 21 Feb 2020 22:12:42 +0000 (14:12 -0800)] 
some Fossies-reported spelling errors were accidentally left unfixed

6 years agoMerge branch 'each-dlz-build' into 'master'
Evan Hunt [Fri, 21 Feb 2020 17:19:56 +0000 (17:19 +0000)] 
Merge branch 'each-dlz-build' into 'master'

fix build errors in DLZ modules

See merge request isc-projects/bind9!3092

6 years agofix build errors in DLZ modules
Evan Hunt [Thu, 20 Feb 2020 05:53:30 +0000 (21:53 -0800)] 
fix build errors in DLZ modules

6 years agoMerge branch 'michal/clean-up-with-tuning-large-remnants' into 'master'
Michał Kępień [Fri, 21 Feb 2020 12:43:01 +0000 (12:43 +0000)] 
Merge branch 'michal/clean-up-with-tuning-large-remnants' into 'master'

Clean up --with-tuning=large remnants

See merge request isc-projects/bind9!3071

6 years agoClean up --with-tuning=large remnants
Michał Kępień [Fri, 21 Feb 2020 11:51:49 +0000 (12:51 +0100)] 
Clean up --with-tuning=large remnants

The change introduced by commit be159f556568abb9a5dbc494f8441eefdd304a7f
was not fully complete.  Adjust ./configure summary so that it reflects
the new way the --with-tuning switch works, fixing the Autoconf variable
used for determining the value of that switch.  Fix win32utils/Configure
so that it behaves the same way as its Unix counterpart.

6 years agoMerge branch 'marka-fix-signature-test' into 'master'
Mark Andrews [Fri, 21 Feb 2020 06:36:34 +0000 (06:36 +0000)] 
Merge branch 'marka-fix-signature-test' into 'master'

Fix code to generate the test signatues.

See merge request isc-projects/bind9!3102

6 years agoFix code to generate the test signatues.
Mark Andrews [Fri, 21 Feb 2020 05:40:50 +0000 (21:40 -0800)] 
Fix code to generate the test signatues.

* ctx needs to be destroyed before it is regenerated.
* emit the name of the signature to be replaced.
* cleanup memory before asserting so post longjump doesn't detect a
  memory leak.
* comment code.

6 years agoMerge branch '1632-spelling' into 'master'
Evan Hunt [Fri, 21 Feb 2020 06:28:09 +0000 (06:28 +0000)] 
Merge branch '1632-spelling' into 'master'

fix spelling errors reported by Fossies.

Closes #1632

See merge request isc-projects/bind9!3101

6 years agoupdate signatures
Mark Andrews [Fri, 21 Feb 2020 03:54:45 +0000 (14:54 +1100)] 
update signatures

6 years agofix spelling errors reported by Fossies.
Evan Hunt [Thu, 20 Feb 2020 22:49:36 +0000 (14:49 -0800)] 
fix spelling errors reported by Fossies.

6 years agoMerge branch '1279-named-compilezone-should-be-able-to-take-input-from-stdin' into...
Diego dos Santos Fronza [Thu, 20 Feb 2020 15:26:51 +0000 (15:26 +0000)] 
Merge branch '1279-named-compilezone-should-be-able-to-take-input-from-stdin' into 'master'

Resolve "named-compilezone should be able to take input from STDIN"

Closes #1279

See merge request isc-projects/bind9!2552

6 years agoAdded system test
Diego Fronza [Fri, 31 Jan 2020 19:52:43 +0000 (16:52 -0300)] 
Added system test

Added a system test which ensures that named-checkzone works when
taking input data from stdin.

6 years agoEnable named-checkzone and named-compilezone to take input from stdin
Diego Fronza [Thu, 7 Nov 2019 18:28:42 +0000 (15:28 -0300)] 
Enable named-checkzone and named-compilezone to take input from stdin

If a filename (the last argument) is not provided for named-checkzone or
named-compilezone, or if it is a single dash "-" character,
zone data will be read from stdin.

Example of invocation:
cat /etc/zone_name.db | named-compilezone -f text -F raw \
    -o zone_name.raw zone_name

6 years agoMerge branch 'michal/make-a-sed-script-in-doc-arm-makefile.in-portable' into 'master'
Michał Kępień [Thu, 20 Feb 2020 11:26:33 +0000 (11:26 +0000)] 
Merge branch 'michal/make-a-sed-script-in-doc-arm-makefile.in-portable' into 'master'

Make a sed script in doc/arm/Makefile.in portable

See merge request isc-projects/bind9!3058

6 years agoMake a sed script in doc/arm/Makefile.in portable
Michał Kępień [Thu, 20 Feb 2020 11:23:36 +0000 (12:23 +0100)] 
Make a sed script in doc/arm/Makefile.in portable

BSD sed does not recognize \s as a whitespace matching token.  Make the
sed script in doc/arm/Makefile.in which ensures GitLab identifiers are
not split across lines portable by replacing \s with [[:space:]].

6 years agoMerge branch 'michal/increase-lifetime-of-docs-sid-amd64-artifacts' into 'master'
Michał Kępień [Thu, 20 Feb 2020 10:55:19 +0000 (10:55 +0000)] 
Merge branch 'michal/increase-lifetime-of-docs-sid-amd64-artifacts' into 'master'

Increase lifetime of docs:sid:amd64 artifacts

See merge request isc-projects/bind9!3088

6 years agoIncrease lifetime of docs:sid:amd64 artifacts
Michał Kępień [Thu, 20 Feb 2020 10:51:58 +0000 (11:51 +0100)] 
Increase lifetime of docs:sid:amd64 artifacts

Artifacts generated by the docs:sid:amd64 job need to be retained longer
than for other jobs as they are used for building bind.isc.org contents.
If these artifacts are removed too quickly, pipelines in the pages/bind
GitLab project start failing, preventing content updates from being
published.  Increase lifetime of the relevant job artifacts to prevent
this from happening.

6 years agoMerge branch 'michal/fix-lib-isc-tests-socket_test-hangs' into 'master'
Michał Kępień [Thu, 20 Feb 2020 10:47:25 +0000 (10:47 +0000)] 
Merge branch 'michal/fix-lib-isc-tests-socket_test-hangs' into 'master'

Fix lib/isc/tests/socket_test hangs

See merge request isc-projects/bind9!3072

6 years agoFix lib/isc/tests/socket_test hangs
Witold Krecicki [Thu, 20 Feb 2020 10:39:15 +0000 (11:39 +0100)] 
Fix lib/isc/tests/socket_test hangs

6 years agoMerge branch 'wpk/perfork-2-libuv-tuning' into 'master'
Witold Krecicki [Tue, 18 Feb 2020 12:08:16 +0000 (12:08 +0000)] 
Merge branch 'wpk/perfork-2-libuv-tuning' into 'master'

Perfwork 2/6 - libuv tuning - support for uv_{recv/send}mmsg, use of libuv-provided uv_export/import

See merge request isc-projects/bind9!3066

6 years agoUse libuv-provided uv_{export,import} if available.
Witold Kręcicki [Fri, 31 Jan 2020 09:10:44 +0000 (10:10 +0100)] 
Use libuv-provided uv_{export,import} if available.

We were using our own versions of isc_uv_{export,import} functions
for multithreaded TCP listeners. Upcoming libuv version will
contain proper uv_{export,import} functions - use them if they're
available.

6 years agoMake nm->recvbuf larger and heap allocated, to allow uv_recvmmsg usage.
Witold Kręcicki [Wed, 29 Jan 2020 12:16:04 +0000 (13:16 +0100)] 
Make nm->recvbuf larger and heap allocated, to allow uv_recvmmsg usage.

Upcoming version of libuv will suport uv_recvmmsg and uv_sendmmsg. To
use uv_recvmmsg we need to provide a larger buffer and be able to
properly free it.

6 years agoMerge branch 'wpk/perfwork-1-client-mctxpool-taskpool' into 'master'
Witold Krecicki [Tue, 18 Feb 2020 11:13:07 +0000 (11:13 +0000)] 
Merge branch 'wpk/perfwork-1-client-mctxpool-taskpool' into 'master'

Perfwork 1/6 - Use thread-sharded mctxpool and taskpool in ns_client

See merge request isc-projects/bind9!3065

6 years agoUse thread-friendly mctxpool and taskpool in ns_client.
Witold Kręcicki [Tue, 28 Jan 2020 10:05:07 +0000 (11:05 +0100)] 
Use thread-friendly mctxpool and taskpool in ns_client.

Make ns_client mctxpool more thread-friendly by sharding it by
netmgr threadid, use task pool also sharded by thread id to avoid
lock contention.

6 years agoMake isc_task_pause/isc_task_unpause thread safe.
Witold Kręcicki [Tue, 28 Jan 2020 08:08:10 +0000 (09:08 +0100)] 
Make isc_task_pause/isc_task_unpause thread safe.

isc_task_pause/unpause were inherently thread-unsafe - a task
could be paused only once by one thread, if the task was running
while we paused it it led to races. Fix it by making sure that
the task will pause if requested to, and by using a 'pause reference
counter' to count task pause requests - a task will be unpaused
iff all threads unpause it.

Don't remove from queue when pausing task - we lock the queue lock
(expensive), while it's unlikely that the task will be running -
and we'll remove it anyway in dispatcher

6 years agoMerge branch 'each-tweak-penalty' into 'master'
Evan Hunt [Mon, 17 Feb 2020 22:41:54 +0000 (22:41 +0000)] 
Merge branch 'each-tweak-penalty' into 'master'

adjust the clang-format penalties to reduce string breaking

See merge request isc-projects/bind9!3079

6 years agoadjust the clang-format penalties to reduce string breaking
Evan Hunt [Mon, 17 Feb 2020 20:05:39 +0000 (12:05 -0800)] 
adjust the clang-format penalties to reduce string breaking

this corrects some style glitches such as:
```
        long_function_call(arg, arg2, arg3, arg4, arg5, "str"
                                                        "ing");
```
...by adjusting the penalties for breaking strings and call
parameter lists.

6 years agoMerge branch 'ondrej/fix-crash-on-arm64-from-weak-cmpxchg' into 'master'
Ondřej Surý [Sun, 16 Feb 2020 17:41:30 +0000 (17:41 +0000)] 
Merge branch 'ondrej/fix-crash-on-arm64-from-weak-cmpxchg' into 'master'

Fix crash on arm64 from using atomic_compare_exchange_weak outside of the loop

See merge request isc-projects/bind9!3042

6 years agoAdd arm64 to GitLab CI
Ondřej Surý [Mon, 10 Feb 2020 13:32:05 +0000 (05:32 -0800)] 
Add arm64 to GitLab CI

6 years agoReplace non-loop usage of atomic_compare_exchange_weak with strong variant
Ondřej Surý [Wed, 12 Feb 2020 08:17:55 +0000 (09:17 +0100)] 
Replace non-loop usage of atomic_compare_exchange_weak with strong variant

While testing BIND 9 on arm64 8+ core machine, it was discovered that
the weak variants in fact does spuriously fail, we haven't observed that
on other architectures.

This commit replaces all non-loop usage of atomic_compare_exchange_weak
with atomic_compare_exchange_strong.

6 years agoAdded atomic_compare_exchange_strong_acq_rel macro
Diego Fronza [Tue, 11 Feb 2020 20:21:13 +0000 (17:21 -0300)] 
Added atomic_compare_exchange_strong_acq_rel macro

It is much better to read than:
atomic_compare_exchange_strong_explicit() with 5 arguments.

6 years agoMerge branch 'ondrej/clang-format-fixups' into 'master'
Ondřej Surý [Sun, 16 Feb 2020 16:45:34 +0000 (16:45 +0000)] 
Merge branch 'ondrej/clang-format-fixups' into 'master'

clang-format fixups

See merge request isc-projects/bind9!3073

6 years agoFixup the missing clang-format bits
Ondřej Surý [Sun, 16 Feb 2020 16:34:24 +0000 (17:34 +0100)] 
Fixup the missing clang-format bits

6 years agoSwitch to clang-format-10 that's more accessible on more platforms
Ondřej Surý [Sun, 16 Feb 2020 16:34:05 +0000 (17:34 +0100)] 
Switch to clang-format-10 that's more accessible on more platforms

6 years agoMerge branch '1472-threadsanitizer-lock-order-inversion-potential-deadlock-dns_resolv...
Diego dos Santos Fronza [Fri, 14 Feb 2020 18:21:12 +0000 (18:21 +0000)] 
Merge branch '1472-threadsanitizer-lock-order-inversion-potential-deadlock-dns_resolver_createfetch-vs' into 'master'

Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) - dns_resolver_createfetch vs. dns_resolver_prime"

Closes #1472

See merge request isc-projects/bind9!3020

6 years agoFixed disposing of resolver->references in destroy() function
Diego Fronza [Tue, 11 Feb 2020 20:36:57 +0000 (17:36 -0300)] 
Fixed disposing of resolver->references in destroy() function

6 years agoFixed potential-lock-inversion
Diego Fronza [Mon, 10 Feb 2020 21:01:10 +0000 (18:01 -0300)] 
Fixed potential-lock-inversion

This commit simplifies a bit the lock management within dns_resolver_prime()
and prime_done() functions by means of turning resolver's attribute
"priming" into an atomic_bool and by creating only one dependent object on the
lock "primelock", namely the "primefetch" attribute.

By having the attribute "priming" as an atomic type, it save us from having to
use a lock just to test if priming is on or off for the given resolver context
object, within "dns_resolver_prime" function.

The "primelock" lock is still necessary, since dns_resolver_prime() function
internally calls dns_resolver_createfetch(), and whenever this function
succeeds it registers an event in the task manager which could be called by
another thread, namely the "prime_done" function, and this function is
responsible for disposing the "primefetch" attribute in the resolver object,
also for resetting "priming" attribute to false.

It is important that the invariant "priming == false AND primefetch == NULL"
remains constant, so that any thread calling "dns_resolver_prime" knows for sure
that if the "priming" attribute is false, "primefetch" attribute should also be
NULL, so a new fetch context could be created to fulfill this purpose, and
assigned to "primefetch" attribute under the lock protection.

To honor the explanation above, dns_resolver_prime is implemented as follow:
1. Atomically checks the attribute "priming" for the given resolver context.
2. If "priming" is false, assumes that "primefetch" is NULL (this is
           ensured by the "prime_done" implementation), acquire "primelock"
   lock and create a new fetch context, update "primefetch" pointer to
   point to the newly allocated fetch context.
3. If "priming" is true, assumes that the job is already in progress,
   no locks are acquired, nothing else to do.

To keep the previous invariant consistent, "prime_done" is implemented as follow:
1. Acquire "primefetch" lock.
2. Keep a reference to the current "primefetch" object;
3. Reset "primefetch" attribute to NULL.
4. Release "primefetch" lock.
5. Atomically update "priming" attribute to false.
6. Destroy the "primefetch" object by using the temporary reference.

This ensures that if "priming" is false, "primefetch" was already reset to NULL.

It doesn't make any difference in having the "priming" attribute not protected
by a lock, since the visible state of this variable would depend on the calling
order of the functions "dns_resolver_prime" and "prime_done".

As an example, suppose that instead of using an atomic for the "priming" attribute
we employed a lock to protect it.
Now suppose that "prime_done" function is called by Thread A, it is then preempted
before acquiring the lock, thus not reseting "priming" to false.
In parallel to that suppose that a Thread B is scheduled and that it calls
"dns_resolver_prime()", it then acquires the lock and check that "priming" is true,
thus it will consider that this resolver object is already priming and it won't do
any more job.
Conversely if the lock order was acquired in the other direction, Thread B would check
that "priming" is false (since prime_done acquired the lock first and set "priming" to false)
and it would initiate a priming fetch for this resolver.

An atomic variable wouldn't change this behavior, since it would behave exactly the
same, depending on the function call order, with the exception that it would avoid
having to use a lock.

There should be no side effects resulting from this change, since the previous
implementation employed use of the more general resolver's "lock" mutex, which
is used in far more contexts, but in the specifics of the "dns_resolver_prime"
and "prime_done" it was only used to protect "primefetch" and "priming" attributes,
which are not used in any of the other critical sections protected by the same lock,
thus having zero dependency on those variables.

6 years agoAdded atomic_compare_exchange_strong_acq_rel macro
Diego Fronza [Tue, 11 Feb 2020 20:21:13 +0000 (17:21 -0300)] 
Added atomic_compare_exchange_strong_acq_rel macro

It is much better to read than:
atomic_compare_exchange_strong_explicit() with 5 arguments.

6 years agoMerge branch '46-enforce-clang-format-rules' into 'master'
Ondřej Surý [Fri, 14 Feb 2020 08:45:45 +0000 (08:45 +0000)] 
Merge branch '46-enforce-clang-format-rules' into 'master'

Start enforcing the clang-format rules on changed files

Closes #46

See merge request isc-projects/bind9!3063

6 years agoDon't enforce copyrights on .clang-format
Ondřej Surý [Fri, 14 Feb 2020 08:34:21 +0000 (09:34 +0100)] 
Don't enforce copyrights on .clang-format

6 years agoReformat using the new rules
Ondřej Surý [Fri, 14 Feb 2020 07:14:03 +0000 (08:14 +0100)] 
Reformat using the new rules

6 years agoAdd separate .clang-format files for headers
Ondřej Surý [Fri, 14 Feb 2020 08:14:28 +0000 (09:14 +0100)] 
Add separate .clang-format files for headers

6 years agoSwitch AlwaysBreakAfterReturnType from TopLevelDefinitions to All
Ondřej Surý [Fri, 14 Feb 2020 07:11:40 +0000 (08:11 +0100)] 
Switch AlwaysBreakAfterReturnType from TopLevelDefinitions to All

The AlwaysBreakAfterReturnType: TopLevelDefinitions was unwrapping
the declarations of the functions in the header files.

6 years agoStart enforcing the clang-format rules on changed files
Ondřej Surý [Fri, 14 Feb 2020 06:10:06 +0000 (07:10 +0100)] 
Start enforcing the clang-format rules on changed files

6 years agoMerge branch 'each-style-tweak' into 'master'
Ondřej Surý [Fri, 14 Feb 2020 05:35:17 +0000 (05:35 +0000)] 
Merge branch 'each-style-tweak' into 'master'

adjust clang-format options to get closer to ISC style

See merge request isc-projects/bind9!3061

6 years agoapply the modified style
Evan Hunt [Thu, 13 Feb 2020 22:44:37 +0000 (14:44 -0800)] 
apply the modified style

6 years agorevise .clang-format and add a C formatting script in util
Evan Hunt [Thu, 13 Feb 2020 18:16:25 +0000 (10:16 -0800)] 
revise .clang-format and add a C formatting script in util

- add util/cformat.sh, which runs clang-format on all C files with
  the default .clang-format, and on all header files with a slightly
  modified version.
- use correct bracing after multi-line control statements
- stop aligning variable declarations to avoid problems with pointer
  alignment, but retain aligned declarations in header files so that
  struct definitions look cleaner.
- static function prototypes in C files can skip the line break after
  the return type, but function prototypes in header files still have
  the line break.
- don't break-before-brace in function definitions. ISC style calls
  for braces on the same line when function parameters fit on a single
  line, and a line break if they don't, but clang-format doesn't yet
  support that distinction. one-line function definitions are about
  four times more common than multi-line, so let's use the option that
  deviates less.

6 years agoMerge branch '46-add-curly-braces' into 'master'
Ondřej Surý [Thu, 13 Feb 2020 21:28:07 +0000 (21:28 +0000)] 
Merge branch '46-add-curly-braces' into 'master'

Add curly braces using uncrustify and then reformat with clang-format back

Closes #46

See merge request isc-projects/bind9!3057

6 years agoUse clang-tidy to add curly braces around one-line statements
Ondřej Surý [Thu, 13 Feb 2020 20:48:23 +0000 (21:48 +0100)] 
Use clang-tidy to add curly braces around one-line statements

The command used to reformat the files in this commit was:

./util/run-clang-tidy \
-clang-tidy-binary clang-tidy-11
-clang-apply-replacements-binary clang-apply-replacements-11 \
-checks=-*,readability-braces-around-statements \
-j 9 \
-fix \
-format \
-style=file \
-quiet
clang-format -i --style=format $(git ls-files '*.c' '*.h')
uncrustify -c .uncrustify.cfg --replace --no-backup $(git ls-files '*.c' '*.h')
clang-format -i --style=format $(git ls-files '*.c' '*.h')

6 years agoAdd copy of run-clang-tidy that can fixup the filepaths
Ondřej Surý [Thu, 13 Feb 2020 17:26:32 +0000 (18:26 +0100)] 
Add copy of run-clang-tidy that can fixup the filepaths

6 years agoUse coccinelle to add braces to nested single line statement
Ondřej Surý [Thu, 13 Feb 2020 17:16:57 +0000 (18:16 +0100)] 
Use coccinelle to add braces to nested single line statement

Both clang-tidy and uncrustify chokes on statement like this:

for (...)
if (...)
break;

This commit uses a very simple semantic patch (below) to add braces around such
statements.

Semantic patch used:

@@
statement S;
expression E;
@@

while (...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

for (...;...;...)
- if (E) S
+ { if (E) { S } }

@@
statement S;
expression E;
@@

if (...)
- if (E) S
+ { if (E) { S } }

6 years agoMerge branch 'mnowak/coverity-disable-web-tag' into 'master'
Michal Nowak [Wed, 12 Feb 2020 14:44:56 +0000 (14:44 +0000)] 
Merge branch 'mnowak/coverity-disable-web-tag' into 'master'

Run Coverity Scan only when specific variables are present

See merge request isc-projects/bind9!3050

6 years agoRun Coverity Scan only when specific variables are present
Michal Nowak [Wed, 12 Feb 2020 14:44:55 +0000 (14:44 +0000)] 
Run Coverity Scan only when specific variables are present

Submissions to Coverity Scan should be limited to those originated from
release branches and only from a specific schedule which holds
COVERITY_SCAN_PROJECT_NAME and COVERITY_SCAN_TOKEN variables.

6 years agoMerge branch '46-just-use-clang-format-to-reformat-sources' into 'master'
Ondřej Surý [Wed, 12 Feb 2020 14:33:32 +0000 (14:33 +0000)] 
Merge branch '46-just-use-clang-format-to-reformat-sources' into 'master'

Reformat source code with clang-format

Closes #46

See merge request isc-projects/bind9!2156

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