Commit graph

10853 commits

Author SHA1 Message Date
Tinderbox User
72326f7701 update copyright notice / whitespace 2018-02-18 23:47:45 +00:00
Ondřej Surý
4801f40e4d Merge branch 'master' into 'master'
Master

See merge request isc-projects/bind9!36
2018-02-16 17:19:26 -05:00
Michał Kępień
02063cbae2 Make dns_dt_send() call dns_dt_reopen() asynchronously
Instead of checking current dnstap output file size and potentially
synchronously calling dns_dt_reopen() upon every call to dns_dt_send():

  - call dns_dt_reopen() asynchronously by queuing an event to the task
    specified at dnstap environment creation time,

  - ensure no roll event is outstanding before checking dnstap output
    file size and potentially queuing another roll event.

This causes dnstap output files to exceed their configured size limits,
but prevents any two threads from performing the roll simultaneously
(which causes crashes).
2018-02-16 09:39:24 +01:00
Michał Kępień
8e3c16175a Make dns_dt_reopen() request task-exclusive mode on its own
Instead of relying on the caller to set up task-exclusive mode, make
dns_dt_reopen() enforce task-exclusive mode itself, using the task
specified at dnstap environment creation time.
2018-02-16 09:39:24 +01:00
Michał Kępień
f199a5a9ae Add dns_dt_create2()
Implement a new variant of dns_dt_create() to enable a dnstap
environment structure to hold the task in the context of which
dns_dt_reopen() will be executed.
2018-02-16 09:39:24 +01:00
Mark Andrews
f181b30918 add POST(len); 2018-02-16 10:20:39 +11:00
Mark Andrews
2e83674170 conditionally declare stacksize 2018-02-16 10:20:39 +11:00
Mark Andrews
801cef9684 add POST(len); 2018-02-16 10:20:39 +11:00
Mark Andrews
99d02c6531 Clarify calculation precedence for '&' and '?' 2018-02-16 10:20:39 +11:00
Mark Andrews
a46e90b2b7 add POST(tl) 2018-02-16 10:20:39 +11:00
Mark Andrews
acdecd4636 test for == 0 rather than <= as value is unsigned 2018-02-16 10:20:39 +11:00
Mark Andrews
a7eb3b3b76 use %u instead of %d 2018-02-16 10:20:39 +11:00
Mark Andrews
4528297486 use %u instead of %d 2018-02-16 10:20:39 +11:00
Mark Andrews
8f8ce953ce use %u instead of %d 2018-02-16 10:20:39 +11:00
Mark Andrews
fc38731c85 use %u instead of %d 2018-02-16 10:20:39 +11:00
Mark Andrews
1eb1eaac94 use %u instead of %d 2018-02-16 10:20:39 +11:00
Mark Andrews
b492700759 use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
54275e8f5c use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
c7e848ce54 use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
1cdb19eaae use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
5bc9ede092 use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
e632696a6d case to unsigned; reorder expression 2018-02-16 10:20:38 +11:00
Mark Andrews
500248b6c1 simplify expression 2018-02-16 10:20:38 +11:00
Mark Andrews
97d4a1eaf5 use %u and preserve unsigned property 2018-02-16 10:20:38 +11:00
Mark Andrews
b5167607ef make declaration and use of setnocookie fully conditional 2018-02-16 10:20:38 +11:00
Mark Andrews
6bd6bd6d62 cast to unsigned 2018-02-16 10:20:38 +11:00
Mark Andrews
78ad353491 preserve unsigned property 2018-02-16 10:20:38 +11:00
Mark Andrews
c23eef5ff1 make both arguments of & unsigned 2018-02-16 10:20:38 +11:00
Mark Andrews
b513bbe9ff use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
34a4d241c6 shift unsigned (~0U) rather than signed (~0) contant 2018-02-16 10:20:38 +11:00
Mark Andrews
75a291e541 use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
dc3951c800 unsigned constants 2018-02-16 10:20:38 +11:00
Mark Andrews
9520cf8559 unsigned constants 2018-02-16 10:20:38 +11:00
Mark Andrews
0f8b0dc5d4 use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
eaddb0c686 use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
b234797536 use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
2b803b3463 prevent implict conversion to signed 2018-02-16 10:20:38 +11:00
Mark Andrews
4a3c1fb45e use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
7d375efaea INSIST ipnum6 != NULL 2018-02-16 10:20:38 +11:00
Mark Andrews
898d7e99a9 use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
a8fa4a9e42 use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
b1b9257c8f test for >= 0 and use %d instead of %u 2018-02-16 10:20:38 +11:00
Mark Andrews
17d971a405 formally cast to int; use %u instead of %d 2018-02-16 10:20:38 +11:00
Mark Andrews
8aff92c150 formally cast to int 2018-02-16 10:20:38 +11:00
Michał Kępień
3abc7bf264 Merge branch 'fix-loadpending-handling' into 'master'
Fix DNS_ZONEFLG_LOADPENDING handling

See merge request isc-projects/bind9!22
2018-02-15 16:18:32 -05:00
Evan Hunt
883a9485e9 [master] copyrights 2018-02-15 11:56:13 -08:00
Michał Kępień
f5079bb877 Do not recheck DNS_ZONEFLG_LOADPENDING in zone_asyncload()
Remove a block of code which dates back to commit 8a2ab2b920, when
dns_zone_asyncload() did not yet check DNS_ZONEFLG_LOADPENDING.
Currently, no race in accessing DNS_ZONEFLG_LOADPENDING is possible any
more, because:

  - dns_zone_asyncload() is still the only function which may queue
    zone_asyncload(),

  - dns_zone_asyncload() accesses DNS_ZONEFLG_LOADPENDING under a lock
    (and potentially queues an event under the same lock),

  - DNS_ZONEFLG_LOADPENDING is not cleared until the load actually
    completes.

Thus, the rechecking code can be safely removed from zone_asyncload().

Note that this also brings zone_asyncload() to a state in which the
completion callback is always invoked.  This is required to prevent
leaking memory in case something goes wrong in zone_asyncload() and a
zone table the zone belongs to is indefinitely left with a positive
reference count.
2018-02-15 20:31:54 +01:00
Michał Kępień
b9e9361c7b Asynchronous zone load events have no way of getting canceled
Code handling cancellation of asynchronous zone load events was likely
copied over from other functions when asynchronous zone loading was
first implemented in commit 8a2ab2b920.  However, unlike those other
functions, asynchronous zone loading events currently have no way of
getting canceled once they get posted, which means the aforementioned
code is effectively dead.  Remove it to prevent confusion.
2018-02-15 20:31:53 +01:00
Michał Kępień
29b7efdd9f Only clear DNS_ZONEFLG_LOADPENDING in zone_asyncload() if zone loading is completed immediately
zone_load() is not always synchronous, it may only initiate an
asynchronous load and return DNS_R_CONTINUE, which means zone loading
has not yet been completed.  In such a case, zone_asyncload() must not
clear DNS_ZONEFLG_LOADPENDING immediately and leave that up to
zone_postload().
2018-02-15 20:31:51 +01:00
Michał Kępień
0e4fba2ced Lock zone before checking whether its asynchronous load is already pending
While this is not an issue in named, which only calls
dns_zone_asyncload() from task-exclusive mode, this function is exported
by libdns and thus may in theory be concurrently called for the same
zone by multiple threads.  It also does not hurt to be consistent
locking-wise with other DNS_ZONEFLG_LOADPENDING accesses.
2018-02-15 20:31:49 +01:00