Commit 00e7d7a0 authored by Bob Halley's avatar Bob Halley
Browse files

Add DNSSEC security roots RBT

parent e24ae707
......@@ -80,6 +80,7 @@ struct dns_view {
dns_resolver_t * resolver;
dns_db_t * cachedb;
dns_db_t * hints;
dns_rbt_t * secroots;
isc_mutex_t lock;
isc_boolean_t frozen;
/* Locked by lock. */
......
......@@ -29,6 +29,7 @@
#include <dns/dbtable.h>
#include <dns/db.h>
#include <dns/fixedname.h>
#include <dns/rbt.h>
#include <dns/rdataset.h>
#include <dns/resolver.h>
#include <dns/view.h>
......@@ -74,6 +75,15 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, char *name,
result = ISC_R_UNEXPECTED;
goto cleanup_mutex;
}
view->secroots = NULL;
result = dns_rbt_create(mctx, NULL, NULL, &view->secroots);
if (result != ISC_R_SUCCESS) {
UNEXPECTED_ERROR(__FILE__, __LINE__,
"dns_rbt_create() failed: %s",
isc_result_totext(result));
result = ISC_R_UNEXPECTED;
goto cleanup_dbtable;
}
view->cachedb = NULL;
view->hints = NULL;
......@@ -88,6 +98,9 @@ dns_view_create(isc_mem_t *mctx, dns_rdataclass_t rdclass, char *name,
return (ISC_R_SUCCESS);
cleanup_dbtable:
dns_dbtable_detach(&view->dbtable);
cleanup_mutex:
isc_mutex_destroy(&view->lock);
......@@ -131,6 +144,7 @@ destroy(dns_view_t *view) {
dns_db_detach(&view->hints);
if (view->cachedb != NULL)
dns_db_detach(&view->cachedb);
dns_rbt_destroy(&view->secroots);
dns_dbtable_detach(&view->dbtable);
isc_mutex_destroy(&view->lock);
isc_mem_free(view->mctx, view->name);
......
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