Commit 29c5e3b8 authored by Brian Wellington's avatar Brian Wellington
Browse files

Initialize and destroy the TSIG subsystem

parent 6d4886fa
...@@ -216,11 +216,17 @@ setup() { ...@@ -216,11 +216,17 @@ setup() {
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
early_fatal("ns_server_init() failed: %s", early_fatal("ns_server_init() failed: %s",
isc_result_totext(result)); isc_result_totext(result));
result = dns_tsig_init(ns_g_mctx);
if (result != ISC_R_SUCCESS)
early_fatal("dns_tsig_init() failed: %s",
isc_result_totext(result));
} }
static void static void
cleanup() { cleanup() {
destroy_managers(); destroy_managers();
dns_tsig_destroy();
#if 0 #if 0
isc_rwlock_destroy(&ns_g_viewlock); isc_rwlock_destroy(&ns_g_viewlock);
#endif #endif
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <dns/resolver.h> #include <dns/resolver.h>
#include <dns/events.h> #include <dns/events.h>
#include <dns/dispatch.h> #include <dns/dispatch.h>
#include <dns/tsig.h>
isc_mutex_t lock; isc_mutex_t lock;
...@@ -184,6 +185,8 @@ main(int argc, char *argv[]) { ...@@ -184,6 +185,8 @@ main(int argc, char *argv[]) {
socketmgr = NULL; socketmgr = NULL;
RUNTIME_CHECK(isc_socketmgr_create(mctx, &socketmgr) == ISC_R_SUCCESS); RUNTIME_CHECK(isc_socketmgr_create(mctx, &socketmgr) == ISC_R_SUCCESS);
RUNTIME_CHECK(dns_tsig_init(mctx) == ISC_R_SUCCESS);
argc -= optind; argc -= optind;
argv += optind; argv += optind;
...@@ -239,6 +242,7 @@ main(int argc, char *argv[]) { ...@@ -239,6 +242,7 @@ main(int argc, char *argv[]) {
isc_socketmgr_destroy(&socketmgr); isc_socketmgr_destroy(&socketmgr);
isc_timermgr_destroy(&timermgr); isc_timermgr_destroy(&timermgr);
dns_tsig_destroy();
if (verbose) if (verbose)
isc_mem_stats(mctx, stdout); isc_mem_stats(mctx, stdout);
isc_mem_destroy(&mctx); isc_mem_destroy(&mctx);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment