Commit Graph

25243 Commits

Author SHA1 Message Date
Evan Hunt
8d20136739 [v9_10] add missing release note, update README 2018-02-17 20:04:06 -08:00
Michał Kępień
0c1061db57 Merge branch 'fix-loadpending-handling-v9_10' into v9_10 2018-02-16 09:00:25 +01:00
Michał Kępień
0e2b3e97a4 Add CHANGES entry
4892.	[bug]		named could leak memory when "rndc reload" was invoked
			before all zone loading actions triggered by a previous
			"rndc reload" command were completed. [RT #47076]
2018-02-16 08:59:56 +01:00
Michał Kępień
fbc282e6bf 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-16 08:59:46 +01:00
Michał Kępień
dbec050c4e 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-16 08:59:46 +01:00
Michał Kępień
af8c5e4013 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-16 08:59:46 +01:00
Michał Kępień
3bc01f9452 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-16 08:59:46 +01:00
Mark Andrews
ecaaa42c6b Merge branch 'fix-cpp-check-errors' into 'v9_10'
Fix cpp check errors

See merge request isc-projects/bind9!31
2018-02-16 01:38:21 -05:00
Mark Andrews
29d304c630 s/cppchecker/cppcheck 2018-02-16 17:34:46 +11:00
Mark Andrews
a0a1b5f64d add GL issue number 2018-02-16 17:34:46 +11:00
Mark Andrews
06f6df737a add CHANGES note 2018-02-16 17:34:45 +11:00
Mark Andrews
4fdaf7e923 add POST(len); 2018-02-16 17:33:38 +11:00
Mark Andrews
3922e41963 conditionally declare stacksize 2018-02-16 17:32:35 +11:00
Mark Andrews
751ba7b551 add POST(len); 2018-02-16 17:31:00 +11:00
Mark Andrews
86ebdae0e0 Clarify calculation precedence for '&' and '?' 2018-02-16 17:28:25 +11:00
Mark Andrews
7ba538a21f add POST(tl) 2018-02-16 17:24:28 +11:00
Mark Andrews
0364226891 return failure count 2018-02-16 17:22:03 +11:00
Mark Andrews
cb3958cc6c conditionally declare strbuf 2018-02-16 17:20:28 +11:00
Mark Andrews
b6b9a1471b test for == 0 rather than <= as value is unsigned 2018-02-16 17:18:18 +11:00
Mark Andrews
47ef7460ef add brackets 2018-02-16 17:15:49 +11:00
Mark Andrews
fdb3dbf32f reorder test to silence cppcheck 2018-02-16 17:15:49 +11:00
Mark Andrews
7839571d34 remove event which is only used for sizeof 2018-02-16 17:15:49 +11:00
Mark Andrews
076135bf52 reorder test to silence cppcheck 2018-02-16 17:13:43 +11:00
Mark Andrews
b67cf8f2da use %u instead of %d 2018-02-16 17:12:51 +11:00
Mark Andrews
de535fee55 use %u instead of %d 2018-02-16 17:12:51 +11:00
Mark Andrews
6a724b765e use %u instead of %d 2018-02-16 17:12:03 +11:00
Mark Andrews
cb2c567e6d use %u instead of %d 2018-02-16 17:10:58 +11:00
Mark Andrews
c30a9cdaa3 use %u instead of %d 2018-02-16 17:10:02 +11:00
Mark Andrews
b5cc00e400 use %u instead of %d 2018-02-16 17:08:36 +11:00
Mark Andrews
dd27ab1f00 use %u instead of %d 2018-02-16 17:08:36 +11:00
Mark Andrews
50f978042e use %u instead of %d 2018-02-16 17:08:36 +11:00
Mark Andrews
a33e639d26 use %u instead of %d 2018-02-16 17:07:16 +11:00
Mark Andrews
cb29c18cfe case to unsigned; reorder expression 2018-02-16 17:05:11 +11:00
Mark Andrews
24f1d23185 simplify expression 2018-02-16 17:02:03 +11:00
Mark Andrews
a37769ca0d use %u and preserve unsigned property 2018-02-16 17:02:03 +11:00
Mark Andrews
8f3e807d19 cast to unsigned 2018-02-16 16:57:00 +11:00
Mark Andrews
f9195e267c preserve unsigned property 2018-02-16 16:57:00 +11:00
Mark Andrews
259c3ef8b8 use %u instead of %d 2018-02-16 16:54:19 +11:00
Mark Andrews
d81ec6ef5c make both arguments of & unsigned 2018-02-16 16:54:19 +11:00
Mark Andrews
cae75cd6e3 use %u instead of %d 2018-02-16 16:51:21 +11:00
Mark Andrews
0e7eb72847 shift unsigned (~0U) rather than signed (~0) contant 2018-02-16 16:48:53 +11:00
Mark Andrews
7180c8b397 use %u instead of %d 2018-02-16 16:37:44 +11:00
Mark Andrews
1397e08dd8 unsigned constants 2018-02-16 16:35:58 +11:00
Mark Andrews
a3f202c970 unsigned constants 2018-02-16 16:33:25 +11:00
Mark Andrews
ba2742d736 use %u instead of %d 2018-02-16 16:31:18 +11:00
Mark Andrews
19ea100fbd use %u instead of %d 2018-02-16 16:31:18 +11:00
Mark Andrews
127305d56e use %u instead of %d 2018-02-16 16:28:54 +11:00
Mark Andrews
5e53842a96 INSIST ipnum6 != NULL 2018-02-16 16:27:05 +11:00
Mark Andrews
00bbd26f1f use %u instead of %d 2018-02-16 16:24:48 +11:00
Mark Andrews
e0caec31e6 use %u instead of %d 2018-02-16 16:22:46 +11:00