mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-09 02:02:06 -04:00
Add DNSSEC security roots RBT
This commit is contained in:
parent
e24ae70756
commit
00e7d7a0e8
2 changed files with 15 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue