mirror of
https://github.com/isc-projects/bind9.git
synced 2026-02-22 01:10:41 -05:00
Delay kserver cleanup until all tasks finishes
It might be possible some pending task would run when kserver is already
cleaned up. Postpone gsstsig structures cleanup after task and timer
managers are destroyed. No pending threads are possible after it.
Make action in maybeshutdown only if doshutdown was not already called.
Might be called from getinput event.
(cherry picked from commit 2685e69be8)
This commit is contained in:
parent
ded53d8762
commit
d33aef43de
1 changed files with 26 additions and 14 deletions
|
|
@ -831,6 +831,10 @@ doshutdown(void) {
|
|||
|
||||
static void
|
||||
maybeshutdown(void) {
|
||||
/* when called from getinput, doshutdown might be already finished */
|
||||
if (requestmgr == NULL)
|
||||
return;
|
||||
|
||||
ddebug("Shutting down request manager");
|
||||
dns_requestmgr_shutdown(requestmgr);
|
||||
|
||||
|
|
@ -2979,6 +2983,8 @@ send_gssrequest(isc_sockaddr_t *destaddr, dns_message_t *msg,
|
|||
isc_sockaddr_t *srcaddr;
|
||||
|
||||
debug("send_gssrequest");
|
||||
REQUIRE(destaddr != NULL);
|
||||
|
||||
reqinfo = isc_mem_get(gmctx, sizeof(nsu_gssinfo_t));
|
||||
if (reqinfo == NULL)
|
||||
fatal("out of memory");
|
||||
|
|
@ -3269,20 +3275,6 @@ cleanup(void) {
|
|||
ddebug("Detaching GSS-TSIG keyring");
|
||||
dns_tsigkeyring_detach(&gssring);
|
||||
}
|
||||
if (kserver != NULL) {
|
||||
isc_mem_put(gmctx, kserver, sizeof(isc_sockaddr_t));
|
||||
kserver = NULL;
|
||||
}
|
||||
if (realm != NULL) {
|
||||
isc_mem_free(gmctx, realm);
|
||||
realm = NULL;
|
||||
}
|
||||
if (dns_name_dynamic(&tmpzonename)) {
|
||||
dns_name_free(&tmpzonename, gmctx);
|
||||
}
|
||||
if (dns_name_dynamic(&restart_master)) {
|
||||
dns_name_free(&restart_master, gmctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (sig0key != NULL)
|
||||
|
|
@ -3306,6 +3298,26 @@ cleanup(void) {
|
|||
ddebug("Destroying name state");
|
||||
dns_name_destroy();
|
||||
|
||||
#ifdef GSSAPI
|
||||
/*
|
||||
* Cleanup GSSAPI resources after taskmgr has been destroyed.
|
||||
*/
|
||||
if (kserver != NULL) {
|
||||
isc_mem_put(gmctx, kserver, sizeof(isc_sockaddr_t));
|
||||
kserver = NULL;
|
||||
}
|
||||
if (realm != NULL) {
|
||||
isc_mem_free(gmctx, realm);
|
||||
realm = NULL;
|
||||
}
|
||||
if (dns_name_dynamic(&tmpzonename)) {
|
||||
dns_name_free(&tmpzonename, gmctx);
|
||||
}
|
||||
if (dns_name_dynamic(&restart_master)) {
|
||||
dns_name_free(&restart_master, gmctx);
|
||||
}
|
||||
#endif
|
||||
|
||||
ddebug("Removing log context");
|
||||
isc_log_destroy(&glctx);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue