]> git.ipfire.org Git - thirdparty/bind9.git/commit
Call dns_resolver_createfetch() asynchronously in zone_refreshkeys()
authorEvan Hunt <each@isc.org>
Sun, 23 Oct 2022 18:39:44 +0000 (11:39 -0700)
committerEvan Hunt <each@isc.org>
Tue, 1 Nov 2022 07:23:05 +0000 (00:23 -0700)
commit28d0c37ef0ea310571eb8ecab0f28207edb04881
tree0c9dede6cb3a5c7c6d24898264203b4cb3a5c6ac
parentc8ff8108e7493802db30d17d0fb95731b32f39da
Call dns_resolver_createfetch() asynchronously in zone_refreshkeys()

Because dns_resolver_createfetch() locks the view, it was necessary
to unlock the zone in zone_refreshkeys() before calling it in order
to maintain the lock order, and relock afterward. this permitted a race
with dns_zone_synckeyzone().

This commit moves the call to dns_resolver_createfetch() into a separate
function which is called asynchronously after the zone has been
unlocked.

The keyfetch object now attaches to the zone to ensure that
it won't be shut down before the asynchronous call completes.

This necessitated refactoring dns_zone_detach() so it always runs
unlocked. For managed zones it schedules zone_shutdown() to
run asynchronously; for unmanaged zones there is no task.
lib/dns/zone.c
tests/dns/zonemgr_test.c