mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-23 11:48:53 -04: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
7e4eb8ad36
commit
596a0f27c4
1 changed files with 26 additions and 14 deletions
|
|
@ -750,6 +750,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);
|
||||
|
||||
|
|
@ -3027,6 +3031,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));
|
||||
reqinfo->msg = msg;
|
||||
reqinfo->addr = destaddr;
|
||||
|
|
@ -3318,20 +3324,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 /* ifdef GSSAPI */
|
||||
|
||||
if (sig0key != NULL) {
|
||||
|
|
@ -3350,6 +3342,26 @@ cleanup(void) {
|
|||
ddebug("Shutting down timer manager");
|
||||
isc_timermgr_destroy(&timermgr);
|
||||
|
||||
#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 /* ifdef GSSAPI */
|
||||
|
||||
ddebug("Removing log context");
|
||||
isc_log_destroy(&glctx);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue