mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-22 17:30:44 -05:00
Reorder the nsupdate shutdown code to shutdown managers early
If the dns_request send callback is delayed, the dst API would get
deinitialized and then the detach from the tsig key would cause an
assertion failure.
Shutdown the isc_managers early, and only then dereference the dst
objects when cleaning up the resources used by nsupdate.
(cherry picked from commit be34b1c535)
This commit is contained in:
parent
c6f8e68dd8
commit
2e461b9012
1 changed files with 9 additions and 9 deletions
|
|
@ -719,12 +719,6 @@ doshutdown(void) {
|
|||
dns_message_detach(&updatemsg);
|
||||
}
|
||||
|
||||
if (is_dst_up) {
|
||||
ddebug("Destroy DST lib");
|
||||
dst_lib_destroy();
|
||||
is_dst_up = false;
|
||||
}
|
||||
|
||||
ddebug("Destroying request manager");
|
||||
dns_requestmgr_detach(&requestmgr);
|
||||
|
||||
|
|
@ -3305,6 +3299,9 @@ cleanup(void) {
|
|||
}
|
||||
UNLOCK(&answer_lock);
|
||||
|
||||
ddebug("Shutting down managers");
|
||||
isc_managers_destroy(&netmgr, &taskmgr, NULL);
|
||||
|
||||
#if HAVE_GSSAPI
|
||||
if (tsigkey != NULL) {
|
||||
ddebug("detach tsigkey x%p", tsigkey);
|
||||
|
|
@ -3320,9 +3317,6 @@ cleanup(void) {
|
|||
dst_key_free(&sig0key);
|
||||
}
|
||||
|
||||
ddebug("Shutting down managers");
|
||||
isc_managers_destroy(&netmgr, &taskmgr, NULL);
|
||||
|
||||
ddebug("Destroying event");
|
||||
isc_event_free(&global_event);
|
||||
|
||||
|
|
@ -3356,6 +3350,12 @@ cleanup(void) {
|
|||
isc_mem_destroy(&gmctx);
|
||||
|
||||
isc_mutex_destroy(&answer_lock);
|
||||
|
||||
if (is_dst_up) {
|
||||
ddebug("Destroy DST lib");
|
||||
dst_lib_destroy();
|
||||
is_dst_up = false;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Reference in a new issue