separate generic DB helpers into db_p.h
when the QPDB is implemented, we will need to have both qpdb_p.h and rbtdb_p.h. to prevent name collisions or code duplication, we here create a private header file for generic database implementations, for structures and macros that will be used by both databases. we also rename some functions and structs to more specifically refer to the RBT database, to avoid namespace collision with similar things that will be needed by the QP database later.
This commit is contained in:
@@ -61,6 +61,7 @@ struct dns_dbimplementation {
|
||||
* Built in database implementations are registered here.
|
||||
*/
|
||||
|
||||
#include "db_p.h"
|
||||
#include "rbtdb_p.h"
|
||||
|
||||
unsigned int dns_pps = 0U;
|
||||
|
||||
164
lib/dns/db_p.h
Normal file
164
lib/dns/db_p.h
Normal file
@@ -0,0 +1,164 @@
|
||||
/*
|
||||
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
||||
*
|
||||
* SPDX-License-Identifier: MPL-2.0
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* See the COPYRIGHT file distributed with this work for additional
|
||||
* information regarding copyright ownership.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <isc/heap.h>
|
||||
#include <isc/lang.h>
|
||||
#include <isc/urcu.h>
|
||||
|
||||
#include <dns/nsec3.h>
|
||||
#include <dns/rbt.h>
|
||||
#include <dns/types.h>
|
||||
|
||||
#define RDATATYPE_NCACHEANY DNS_TYPEPAIR_VALUE(0, dns_rdatatype_any)
|
||||
|
||||
#ifdef STRONG_RWLOCK_CHECK
|
||||
#define STRONG_RWLOCK_CHECK(cond) REQUIRE(cond)
|
||||
#else
|
||||
#define STRONG_RWLOCK_CHECK(cond)
|
||||
#endif
|
||||
|
||||
#define NODE_INITLOCK(l) isc_rwlock_init((l))
|
||||
#define NODE_DESTROYLOCK(l) isc_rwlock_destroy(l)
|
||||
#define NODE_LOCK(l, t, tp) \
|
||||
{ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
|
||||
RWLOCK((l), (t)); \
|
||||
*tp = t; \
|
||||
}
|
||||
#define NODE_UNLOCK(l, tp) \
|
||||
{ \
|
||||
STRONG_RWLOCK_CHECK(*tp != isc_rwlocktype_none); \
|
||||
RWUNLOCK(l, *tp); \
|
||||
*tp = isc_rwlocktype_none; \
|
||||
}
|
||||
#define NODE_RDLOCK(l, tp) NODE_LOCK(l, isc_rwlocktype_read, tp);
|
||||
#define NODE_WRLOCK(l, tp) NODE_LOCK(l, isc_rwlocktype_write, tp);
|
||||
#define NODE_TRYLOCK(l, t, tp) \
|
||||
({ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
|
||||
isc_result_t _result = isc_rwlock_trylock(l, t); \
|
||||
if (_result == ISC_R_SUCCESS) { \
|
||||
*tp = t; \
|
||||
}; \
|
||||
_result; \
|
||||
})
|
||||
#define NODE_TRYRDLOCK(l, tp) NODE_TRYLOCK(l, isc_rwlocktype_read, tp)
|
||||
#define NODE_TRYWRLOCK(l, tp) NODE_TRYLOCK(l, isc_rwlocktype_write, tp)
|
||||
#define NODE_TRYUPGRADE(l, tp) \
|
||||
({ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_read); \
|
||||
isc_result_t _result = isc_rwlock_tryupgrade(l); \
|
||||
if (_result == ISC_R_SUCCESS) { \
|
||||
*tp = isc_rwlocktype_write; \
|
||||
}; \
|
||||
_result; \
|
||||
})
|
||||
#define NODE_FORCEUPGRADE(l, tp) \
|
||||
if (NODE_TRYUPGRADE(l, tp) != ISC_R_SUCCESS) { \
|
||||
NODE_UNLOCK(l, tp); \
|
||||
NODE_WRLOCK(l, tp); \
|
||||
}
|
||||
|
||||
#define TREE_INITLOCK(l) isc_rwlock_init(l)
|
||||
#define TREE_DESTROYLOCK(l) isc_rwlock_destroy(l)
|
||||
#define TREE_LOCK(l, t, tp) \
|
||||
{ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
|
||||
RWLOCK(l, t); \
|
||||
*tp = t; \
|
||||
}
|
||||
#define TREE_UNLOCK(l, tp) \
|
||||
{ \
|
||||
STRONG_RWLOCK_CHECK(*tp != isc_rwlocktype_none); \
|
||||
RWUNLOCK(l, *tp); \
|
||||
*tp = isc_rwlocktype_none; \
|
||||
}
|
||||
#define TREE_RDLOCK(l, tp) TREE_LOCK(l, isc_rwlocktype_read, tp);
|
||||
#define TREE_WRLOCK(l, tp) TREE_LOCK(l, isc_rwlocktype_write, tp);
|
||||
#define TREE_TRYLOCK(l, t, tp) \
|
||||
({ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
|
||||
isc_result_t _result = isc_rwlock_trylock(l, t); \
|
||||
if (_result == ISC_R_SUCCESS) { \
|
||||
*tp = t; \
|
||||
}; \
|
||||
_result; \
|
||||
})
|
||||
#define TREE_TRYRDLOCK(l, tp) TREE_TRYLOCK(l, isc_rwlocktype_read, tp)
|
||||
#define TREE_TRYWRLOCK(l, tp) TREE_TRYLOCK(l, isc_rwlocktype_write, tp)
|
||||
#define TREE_TRYUPGRADE(l, tp) \
|
||||
({ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_read); \
|
||||
isc_result_t _result = isc_rwlock_tryupgrade(l); \
|
||||
if (_result == ISC_R_SUCCESS) { \
|
||||
*tp = isc_rwlocktype_write; \
|
||||
}; \
|
||||
_result; \
|
||||
})
|
||||
#define TREE_FORCEUPGRADE(l, tp) \
|
||||
if (TREE_TRYUPGRADE(l, tp) != ISC_R_SUCCESS) { \
|
||||
TREE_UNLOCK(l, tp); \
|
||||
TREE_WRLOCK(l, tp); \
|
||||
}
|
||||
|
||||
#define IS_STUB(db) (((db)->common.attributes & DNS_DBATTR_STUB) != 0)
|
||||
#define IS_CACHE(db) (((db)->common.attributes & DNS_DBATTR_CACHE) != 0)
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
struct dns_glue {
|
||||
struct dns_glue *next;
|
||||
dns_fixedname_t fixedname;
|
||||
dns_rdataset_t rdataset_a;
|
||||
dns_rdataset_t sigrdataset_a;
|
||||
dns_rdataset_t rdataset_aaaa;
|
||||
dns_rdataset_t sigrdataset_aaaa;
|
||||
|
||||
isc_mem_t *mctx;
|
||||
struct rcu_head rcu_head;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
dns_glue_t *glue_list;
|
||||
dns_db_t *db;
|
||||
dns_dbversion_t *version;
|
||||
dns_name_t *nodename;
|
||||
} dns_glue_additionaldata_ctx_t;
|
||||
|
||||
typedef struct {
|
||||
isc_rwlock_t lock;
|
||||
/* Protected in the refcount routines. */
|
||||
isc_refcount_t references;
|
||||
/* Locked by lock. */
|
||||
bool exiting;
|
||||
} db_nodelock_t;
|
||||
|
||||
/*%
|
||||
* Load Context
|
||||
*/
|
||||
typedef struct {
|
||||
dns_db_t *db;
|
||||
isc_stdtime_t now;
|
||||
} db_load_t;
|
||||
|
||||
/*%
|
||||
* Prune context
|
||||
*/
|
||||
typedef struct {
|
||||
dns_db_t *db;
|
||||
dns_dbnode_t *node;
|
||||
} db_prune_t;
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
@@ -698,7 +698,7 @@ dns_rbt_destroy2(dns_rbt_t **rbtp, unsigned int quantum);
|
||||
|
||||
void
|
||||
dns_rbt_printtext(dns_rbt_t *rbt, void (*data_printer)(FILE *, void *),
|
||||
FILE *f);
|
||||
FILE *f);
|
||||
/*%<
|
||||
* Print an ASCII representation of the internal structure of the red-black
|
||||
* tree of trees to the passed stream.
|
||||
|
||||
@@ -75,11 +75,11 @@ typedef enum {
|
||||
} dns_rdatasetadditional_t;
|
||||
|
||||
typedef struct dns_rdatasetmethods {
|
||||
void (*disassociate)(dns_rdataset_t *rdataset DNS__DB_FLARG);
|
||||
void (*disassociate)(dns_rdataset_t *rdataset DNS__DB_FLARG);
|
||||
isc_result_t (*first)(dns_rdataset_t *rdataset);
|
||||
isc_result_t (*next)(dns_rdataset_t *rdataset);
|
||||
void (*current)(dns_rdataset_t *rdataset, dns_rdata_t *rdata);
|
||||
void (*clone)(dns_rdataset_t *source,
|
||||
void (*current)(dns_rdataset_t *rdataset, dns_rdata_t *rdata);
|
||||
void (*clone)(dns_rdataset_t *source,
|
||||
dns_rdataset_t *target DNS__DB_FLARG);
|
||||
unsigned int (*count)(dns_rdataset_t *rdataset);
|
||||
isc_result_t (*addnoqname)(dns_rdataset_t *rdataset,
|
||||
@@ -92,9 +92,9 @@ typedef struct dns_rdatasetmethods {
|
||||
isc_result_t (*getclosest)(dns_rdataset_t *rdataset, dns_name_t *name,
|
||||
dns_rdataset_t *neg,
|
||||
dns_rdataset_t *negsig DNS__DB_FLARG);
|
||||
void (*settrust)(dns_rdataset_t *rdataset, dns_trust_t trust);
|
||||
void (*expire)(dns_rdataset_t *rdataset DNS__DB_FLARG);
|
||||
void (*clearprefetch)(dns_rdataset_t *rdataset);
|
||||
void (*settrust)(dns_rdataset_t *rdataset, dns_trust_t trust);
|
||||
void (*expire)(dns_rdataset_t *rdataset DNS__DB_FLARG);
|
||||
void (*clearprefetch)(dns_rdataset_t *rdataset);
|
||||
void (*setownercase)(dns_rdataset_t *rdataset, const dns_name_t *name);
|
||||
void (*getownercase)(const dns_rdataset_t *rdataset, dns_name_t *name);
|
||||
isc_result_t (*addglue)(dns_rdataset_t *rdataset,
|
||||
@@ -184,12 +184,12 @@ struct dns_rdataset {
|
||||
* comments in rbtdb.c for details.)
|
||||
*/
|
||||
struct {
|
||||
struct dns_db *db;
|
||||
dns_dbnode_t *node;
|
||||
unsigned char *raw;
|
||||
unsigned char *iter_pos;
|
||||
unsigned int iter_count;
|
||||
dns_proof_t *noqname, *closest;
|
||||
struct dns_db *db;
|
||||
dns_dbnode_t *node;
|
||||
unsigned char *raw;
|
||||
unsigned char *iter_pos;
|
||||
unsigned int iter_count;
|
||||
dns_slabheader_proof_t *noqname, *closest;
|
||||
} slab;
|
||||
|
||||
/*
|
||||
|
||||
@@ -60,7 +60,7 @@ ISC_LANG_BEGINDECLS
|
||||
|
||||
#define DNS_RDATASLAB_OFFLINE 0x01 /* RRSIG is for offline DNSKEY */
|
||||
|
||||
struct dns_proof {
|
||||
struct dns_slabheader_proof {
|
||||
dns_name_t name;
|
||||
void *neg;
|
||||
void *negsig;
|
||||
@@ -94,8 +94,8 @@ struct dns_slabheader {
|
||||
|
||||
atomic_uint_fast32_t last_refresh_fail_ts;
|
||||
|
||||
dns_proof_t *noqname;
|
||||
dns_proof_t *closest;
|
||||
dns_slabheader_proof_t *noqname;
|
||||
dns_slabheader_proof_t *closest;
|
||||
/*%<
|
||||
* We don't use the LIST macros, because the LIST structure has
|
||||
* both head and tail pointers, and is doubly linked.
|
||||
@@ -313,4 +313,10 @@ dns_slabheader_destroy(dns_slabheader_t **headerp);
|
||||
/*%<
|
||||
* Free all memory associated with '*headerp'.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_slabheader_freeproof(isc_mem_t *mctx, dns_slabheader_proof_t **proof);
|
||||
/*%<
|
||||
* Free all memory associated with a nonexistence proof.
|
||||
*/
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -19,10 +19,11 @@
|
||||
|
||||
#include <dns/types.h>
|
||||
|
||||
#define DNS_TYPEPAIR_TYPE(type) ((dns_rdatatype_t)((type) & 0xFFFF))
|
||||
#define DNS_TYPEPAIR_TYPE(type) ((dns_rdatatype_t)((type)&0xFFFF))
|
||||
#define DNS_TYPEPAIR_COVERS(type) ((dns_rdatatype_t)((type) >> 16))
|
||||
#define DNS_TYPEPAIR_VALUE(base, ext) \
|
||||
((dns_typepair_t)(((uint32_t)ext) << 16) | (((uint32_t)base) & 0xffff))
|
||||
#define DNS_SIGTYPE(type) DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, (type))
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
|
||||
@@ -118,17 +118,17 @@ typedef isc_region_t dns_label_t;
|
||||
typedef struct dns_name dns_name_t;
|
||||
typedef struct dns_nametree dns_nametree_t;
|
||||
typedef ISC_LIST(dns_name_t) dns_namelist_t;
|
||||
typedef struct dns_ntatable dns_ntatable_t;
|
||||
typedef struct dns_ntnode dns_ntnode_t;
|
||||
typedef uint16_t dns_opcode_t;
|
||||
typedef struct dns_order dns_order_t;
|
||||
typedef struct dns_peer dns_peer_t;
|
||||
typedef struct dns_peerlist dns_peerlist_t;
|
||||
typedef struct dns_proof dns_proof_t;
|
||||
typedef struct dns_rbt dns_rbt_t;
|
||||
typedef struct dns_rbtdb dns_rbtdb_t;
|
||||
typedef struct dns_rbtdb_version dns_rbtdb_version_t;
|
||||
typedef struct dns_rbtnode dns_rbtnode_t;
|
||||
typedef struct dns_ntatable dns_ntatable_t;
|
||||
typedef struct dns_ntnode dns_ntnode_t;
|
||||
typedef uint16_t dns_opcode_t;
|
||||
typedef struct dns_order dns_order_t;
|
||||
typedef struct dns_peer dns_peer_t;
|
||||
typedef struct dns_peerlist dns_peerlist_t;
|
||||
typedef struct dns_slabheader_proof dns_slabheader_proof_t;
|
||||
typedef struct dns_rbt dns_rbt_t;
|
||||
typedef struct dns_rbtdb dns_rbtdb_t;
|
||||
typedef struct dns_rbtdb_version dns_rbtdb_version_t;
|
||||
typedef struct dns_rbtnode dns_rbtnode_t;
|
||||
typedef ISC_LIST(dns_rbtnode_t) dns_rbtnodelist_t;
|
||||
typedef uint16_t dns_rcode_t;
|
||||
typedef struct dns_rdata dns_rdata_t;
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include <dns/zone.h>
|
||||
#include <dns/zonekey.h>
|
||||
|
||||
#include "db_p.h"
|
||||
#include "rbtdb_p.h"
|
||||
|
||||
#define CHECK(op) \
|
||||
@@ -186,9 +187,10 @@ update_header(dns_rbtdb_t *rbtdb, dns_slabheader_t *header, isc_stdtime_t now) {
|
||||
/* To be checked: can we really assume this? XXXMLG */
|
||||
INSIST(ISC_LINK_LINKED(header, link));
|
||||
|
||||
ISC_LIST_UNLINK(rbtdb->lru[HEADER_NODE(header)->locknum], header, link);
|
||||
ISC_LIST_UNLINK(rbtdb->lru[RBTDB_HEADERNODE(header)->locknum], header,
|
||||
link);
|
||||
header->last_used = now;
|
||||
ISC_LIST_PREPEND(rbtdb->lru[HEADER_NODE(header)->locknum], header,
|
||||
ISC_LIST_PREPEND(rbtdb->lru[RBTDB_HEADERNODE(header)->locknum], header,
|
||||
link);
|
||||
}
|
||||
|
||||
@@ -417,7 +419,7 @@ check_stale_header(dns_rbtnode_t *node, dns_slabheader_t *header,
|
||||
} else {
|
||||
dns__rbtdb_mark(header,
|
||||
DNS_SLABHEADERATTR_ANCIENT);
|
||||
HEADER_NODE(header)->dirty = 1;
|
||||
RBTDB_HEADERNODE(header)->dirty = 1;
|
||||
*header_prev = header;
|
||||
}
|
||||
} else {
|
||||
@@ -463,7 +465,7 @@ cache_zonecut_callback(dns_rbtnode_t *node, dns_name_t *name,
|
||||
{
|
||||
dname_header = header;
|
||||
header_prev = header;
|
||||
} else if (header->type == RBTDB_RDATATYPE_SIGDNAME &&
|
||||
} else if (header->type == DNS_SIGTYPE(dns_rdatatype_dname) &&
|
||||
EXISTS(header) && !ANCIENT(header))
|
||||
{
|
||||
sigdname_header = header;
|
||||
@@ -545,7 +547,7 @@ find_deepest_zonecut(rbtdb_search_t *search, dns_rbtnode_t *node,
|
||||
break;
|
||||
}
|
||||
} else if (header->type ==
|
||||
RBTDB_RDATATYPE_SIGNS)
|
||||
DNS_SIGTYPE(dns_rdatatype_ns))
|
||||
{
|
||||
foundsig = header;
|
||||
if (found != NULL) {
|
||||
@@ -923,7 +925,7 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
||||
* target type. Remember it.
|
||||
*/
|
||||
foundsig = header;
|
||||
} else if (header->type == RBTDB_RDATATYPE_NCACHEANY ||
|
||||
} else if (header->type == RDATATYPE_NCACHEANY ||
|
||||
header->type == negtype)
|
||||
{
|
||||
/*
|
||||
@@ -937,7 +939,9 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
||||
* we might need it later.
|
||||
*/
|
||||
nsheader = header;
|
||||
} else if (header->type == RBTDB_RDATATYPE_SIGNS) {
|
||||
} else if (header->type ==
|
||||
DNS_SIGTYPE(dns_rdatatype_ns))
|
||||
{
|
||||
/*
|
||||
* If we need the NS rdataset, we'll also
|
||||
* need its signature.
|
||||
@@ -945,10 +949,11 @@ cache_find(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
|
||||
nssig = header;
|
||||
} else if (header->type == dns_rdatatype_nsec) {
|
||||
nsecheader = header;
|
||||
} else if (header->type == RBTDB_RDATATYPE_SIGNSEC) {
|
||||
} else if (header->type ==
|
||||
DNS_SIGTYPE(dns_rdatatype_nsec))
|
||||
{
|
||||
nsecsig = header;
|
||||
} else if (cname_ok &&
|
||||
header->type == RBTDB_RDATATYPE_SIGCNAME)
|
||||
} else if (cname_ok && DNS_SIGTYPE(dns_rdatatype_cname))
|
||||
{
|
||||
/*
|
||||
* If we get a CNAME match, we'll also need
|
||||
@@ -1267,7 +1272,9 @@ cache_findzonecut(dns_db_t *db, const dns_name_t *name, unsigned int options,
|
||||
* we might need it later.
|
||||
*/
|
||||
found = header;
|
||||
} else if (header->type == RBTDB_RDATATYPE_SIGNS) {
|
||||
} else if (header->type ==
|
||||
DNS_SIGTYPE(dns_rdatatype_ns))
|
||||
{
|
||||
/*
|
||||
* If we need the NS rdataset, we'll also
|
||||
* need its signature.
|
||||
@@ -1394,12 +1401,12 @@ cache_findrdataset(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
|
||||
*/
|
||||
dns__rbtdb_mark(header,
|
||||
DNS_SLABHEADERATTR_ANCIENT);
|
||||
HEADER_NODE(header)->dirty = 1;
|
||||
RBTDB_HEADERNODE(header)->dirty = 1;
|
||||
}
|
||||
} else if (EXISTS(header) && !ANCIENT(header)) {
|
||||
if (header->type == matchtype) {
|
||||
found = header;
|
||||
} else if (header->type == RBTDB_RDATATYPE_NCACHEANY ||
|
||||
} else if (header->type == RDATATYPE_NCACHEANY ||
|
||||
header->type == negtype)
|
||||
{
|
||||
found = header;
|
||||
@@ -1534,8 +1541,8 @@ expiredata(dns_db_t *db, dns_dbnode_t *node, void *data) {
|
||||
isc_rwlocktype_t tlocktype = isc_rwlocktype_none;
|
||||
|
||||
NODE_WRLOCK(&rbtdb->node_locks[rbtnode->locknum].lock, &nlocktype);
|
||||
dns__cachedb_expireheader(header, &tlocktype,
|
||||
dns_expire_flush DNS__DB_FLARG_PASS);
|
||||
dns__cacherbt_expireheader(header, &tlocktype,
|
||||
dns_expire_flush DNS__DB_FLARG_PASS);
|
||||
NODE_UNLOCK(&rbtdb->node_locks[rbtnode->locknum].lock, &nlocktype);
|
||||
INSIST(tlocktype == isc_rwlocktype_none);
|
||||
}
|
||||
@@ -1577,14 +1584,14 @@ dns_dbmethods_t dns__rbtdb_cachemethods = {
|
||||
* Caller must hold the node (write) lock.
|
||||
*/
|
||||
void
|
||||
dns__cachedb_expireheader(dns_slabheader_t *header,
|
||||
isc_rwlocktype_t *tlocktypep,
|
||||
dns_expire_t reason DNS__DB_FLARG) {
|
||||
dns__cacherbt_expireheader(dns_slabheader_t *header,
|
||||
isc_rwlocktype_t *tlocktypep,
|
||||
dns_expire_t reason DNS__DB_FLARG) {
|
||||
dns__rbtdb_setttl(header, 0);
|
||||
dns__rbtdb_mark(header, DNS_SLABHEADERATTR_ANCIENT);
|
||||
HEADER_NODE(header)->dirty = 1;
|
||||
RBTDB_HEADERNODE(header)->dirty = 1;
|
||||
|
||||
if (isc_refcount_current(&HEADER_NODE(header)->references) == 0) {
|
||||
if (isc_refcount_current(&RBTDB_HEADERNODE(header)->references) == 0) {
|
||||
isc_rwlocktype_t nlocktype = isc_rwlocktype_write;
|
||||
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)header->db;
|
||||
|
||||
@@ -1593,10 +1600,11 @@ dns__cachedb_expireheader(dns_slabheader_t *header,
|
||||
* We first need to gain a new reference to the node to meet a
|
||||
* requirement of dns__rbtdb_decref().
|
||||
*/
|
||||
dns__rbtdb_newref(rbtdb, HEADER_NODE(header),
|
||||
dns__rbtdb_newref(rbtdb, RBTDB_HEADERNODE(header),
|
||||
nlocktype DNS__DB_FLARG_PASS);
|
||||
dns__rbtdb_decref(rbtdb, HEADER_NODE(header), 0, &nlocktype,
|
||||
tlocktypep, true, false DNS__DB_FLARG_PASS);
|
||||
dns__rbtdb_decref(rbtdb, RBTDB_HEADERNODE(header), 0,
|
||||
&nlocktype, tlocktypep, true,
|
||||
false DNS__DB_FLARG_PASS);
|
||||
|
||||
if (rbtdb->cachestats == NULL) {
|
||||
return;
|
||||
@@ -1648,8 +1656,8 @@ expire_lru_headers(dns_rbtdb_t *rbtdb, unsigned int locknum,
|
||||
* TTL was reset to 0.
|
||||
*/
|
||||
ISC_LIST_UNLINK(rbtdb->lru[locknum], header, link);
|
||||
dns__cachedb_expireheader(header, tlocktypep,
|
||||
dns_expire_lru DNS__DB_FLARG_PASS);
|
||||
dns__cacherbt_expireheader(header, tlocktypep,
|
||||
dns_expire_lru DNS__DB_FLARG_PASS);
|
||||
purged += header_size;
|
||||
}
|
||||
|
||||
@@ -1670,9 +1678,9 @@ expire_lru_headers(dns_rbtdb_t *rbtdb, unsigned int locknum,
|
||||
* same NS name).
|
||||
*/
|
||||
void
|
||||
dns__cachedb_overmem(dns_rbtdb_t *rbtdb, dns_slabheader_t *newheader,
|
||||
unsigned int locknum_start,
|
||||
isc_rwlocktype_t *tlocktypep DNS__DB_FLARG) {
|
||||
dns__cacherbt_overmem(dns_rbtdb_t *rbtdb, dns_slabheader_t *newheader,
|
||||
unsigned int locknum_start,
|
||||
isc_rwlocktype_t *tlocktypep DNS__DB_FLARG) {
|
||||
unsigned int locknum;
|
||||
size_t purgesize = rdataset_size(newheader);
|
||||
size_t purged = 0;
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include <dns/zone.h>
|
||||
#include <dns/zonekey.h>
|
||||
|
||||
#include "db_p.h"
|
||||
#include "rbtdb_p.h"
|
||||
|
||||
#define CHECK(op) \
|
||||
@@ -133,7 +134,7 @@ zone_zonecut_callback(dns_rbtnode_t *node, dns_name_t *name,
|
||||
header_next = header->next;
|
||||
if (header->type == dns_rdatatype_ns ||
|
||||
header->type == dns_rdatatype_dname ||
|
||||
header->type == RBTDB_RDATATYPE_SIGDNAME)
|
||||
header->type == DNS_SIGTYPE(dns_rdatatype_dname))
|
||||
{
|
||||
do {
|
||||
if (header->serial <= search->serial &&
|
||||
@@ -155,7 +156,7 @@ zone_zonecut_callback(dns_rbtnode_t *node, dns_name_t *name,
|
||||
if (header->type == dns_rdatatype_dname) {
|
||||
dname_header = header;
|
||||
} else if (header->type ==
|
||||
RBTDB_RDATATYPE_SIGDNAME)
|
||||
DNS_SIGTYPE(dns_rdatatype_dname))
|
||||
{
|
||||
sigdname_header = header;
|
||||
} else if (node != onode ||
|
||||
@@ -830,11 +831,11 @@ find_closest_nsec(rbtdb_search_t *search, dns_dbnode_t **nodep,
|
||||
|
||||
if (tree == search->rbtdb->nsec3) {
|
||||
type = dns_rdatatype_nsec3;
|
||||
sigtype = RBTDB_RDATATYPE_SIGNSEC3;
|
||||
sigtype = DNS_SIGTYPE(dns_rdatatype_nsec3);
|
||||
wraps = true;
|
||||
} else {
|
||||
type = dns_rdatatype_nsec;
|
||||
sigtype = RBTDB_RDATATYPE_SIGNSEC;
|
||||
sigtype = DNS_SIGTYPE(dns_rdatatype_nsec);
|
||||
wraps = false;
|
||||
}
|
||||
|
||||
@@ -1284,8 +1285,8 @@ found:
|
||||
if (cnamesig != NULL) {
|
||||
foundsig = cnamesig;
|
||||
} else {
|
||||
sigtype =
|
||||
RBTDB_RDATATYPE_SIGCNAME;
|
||||
sigtype = DNS_SIGTYPE(
|
||||
dns_rdatatype_cname);
|
||||
}
|
||||
}
|
||||
/*
|
||||
@@ -1315,7 +1316,8 @@ found:
|
||||
* we might need it later.
|
||||
*/
|
||||
nsecheader = header;
|
||||
} else if (header->type == RBTDB_RDATATYPE_SIGNSEC &&
|
||||
} else if (header->type ==
|
||||
DNS_SIGTYPE(dns_rdatatype_nsec) &&
|
||||
!search.rbtversion->havensec3)
|
||||
{
|
||||
/*
|
||||
@@ -1324,7 +1326,8 @@ found:
|
||||
*/
|
||||
nsecsig = header;
|
||||
} else if (cname_ok &&
|
||||
header->type == RBTDB_RDATATYPE_SIGCNAME)
|
||||
header->type ==
|
||||
DNS_SIGTYPE(dns_rdatatype_cname))
|
||||
{
|
||||
/*
|
||||
* If we get a CNAME match, we'll also need
|
||||
@@ -1706,8 +1709,8 @@ done:
|
||||
static isc_result_t
|
||||
loading_addrdataset(void *arg, const dns_name_t *name,
|
||||
dns_rdataset_t *rdataset DNS__DB_FLARG) {
|
||||
rbtdb_load_t *loadctx = arg;
|
||||
dns_rbtdb_t *rbtdb = loadctx->rbtdb;
|
||||
db_load_t *loadctx = arg;
|
||||
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)loadctx->db;
|
||||
dns_rbtnode_t *node = NULL;
|
||||
isc_result_t result;
|
||||
isc_region_t region;
|
||||
@@ -1728,7 +1731,7 @@ loading_addrdataset(void *arg, const dns_name_t *name,
|
||||
if (rdataset->type != dns_rdatatype_nsec3 &&
|
||||
rdataset->covers != dns_rdatatype_nsec3)
|
||||
{
|
||||
dns__zonedb_addwildcards(rbtdb, name, false);
|
||||
dns__zonerbt_addwildcards(rbtdb, name, false);
|
||||
}
|
||||
|
||||
if (dns_name_iswildcard(name)) {
|
||||
@@ -1744,7 +1747,7 @@ loading_addrdataset(void *arg, const dns_name_t *name,
|
||||
if (rdataset->type == dns_rdatatype_nsec3) {
|
||||
return (DNS_R_INVALIDNSEC3);
|
||||
}
|
||||
result = dns__zonedb_wildcardmagic(rbtdb, name, false);
|
||||
result = dns__zonerbt_wildcardmagic(rbtdb, name, false);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
@@ -1814,7 +1817,7 @@ loading_addrdataset(void *arg, const dns_name_t *name,
|
||||
|
||||
static isc_result_t
|
||||
beginload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
|
||||
rbtdb_load_t *loadctx = NULL;
|
||||
db_load_t *loadctx = NULL;
|
||||
dns_rbtdb_t *rbtdb = NULL;
|
||||
rbtdb = (dns_rbtdb_t *)db;
|
||||
|
||||
@@ -1823,16 +1826,16 @@ beginload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
|
||||
|
||||
loadctx = isc_mem_get(rbtdb->common.mctx, sizeof(*loadctx));
|
||||
|
||||
loadctx->rbtdb = rbtdb;
|
||||
loadctx->db = db;
|
||||
loadctx->now = 0;
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
|
||||
REQUIRE((rbtdb->attributes &
|
||||
(RBTDB_ATTR_LOADED | RBTDB_ATTR_LOADING)) == 0);
|
||||
rbtdb->attributes |= RBTDB_ATTR_LOADING;
|
||||
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
|
||||
callbacks->add = loading_addrdataset;
|
||||
callbacks->add_private = loadctx;
|
||||
@@ -1842,16 +1845,16 @@ beginload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
|
||||
|
||||
static isc_result_t
|
||||
endload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
|
||||
rbtdb_load_t *loadctx = NULL;
|
||||
db_load_t *loadctx = NULL;
|
||||
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db;
|
||||
|
||||
REQUIRE(VALID_RBTDB(rbtdb));
|
||||
REQUIRE(DNS_CALLBACK_VALID(callbacks));
|
||||
loadctx = callbacks->add_private;
|
||||
REQUIRE(loadctx != NULL);
|
||||
REQUIRE(loadctx->rbtdb == rbtdb);
|
||||
REQUIRE(loadctx->db == db);
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
|
||||
REQUIRE((rbtdb->attributes & RBTDB_ATTR_LOADING) != 0);
|
||||
REQUIRE((rbtdb->attributes & RBTDB_ATTR_LOADED) == 0);
|
||||
@@ -1865,10 +1868,10 @@ endload(dns_db_t *db, dns_rdatacallbacks_t *callbacks) {
|
||||
*/
|
||||
if (rbtdb->origin_node != NULL) {
|
||||
dns_dbversion_t *version = rbtdb->current_version;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
dns__rbtdb_setsecure(db, version, rbtdb->origin_node);
|
||||
} else {
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
}
|
||||
|
||||
callbacks->add = NULL;
|
||||
@@ -1888,9 +1891,9 @@ issecure(dns_db_t *db) {
|
||||
|
||||
REQUIRE(VALID_RBTDB(rbtdb));
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
secure = rbtdb->current_version->secure;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
|
||||
return (secure);
|
||||
}
|
||||
@@ -1908,7 +1911,7 @@ getnsec3parameters(dns_db_t *db, dns_dbversion_t *version, dns_hash_t *hash,
|
||||
REQUIRE(VALID_RBTDB(rbtdb));
|
||||
INSIST(rbtversion == NULL || rbtversion->rbtdb == rbtdb);
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
if (rbtversion == NULL) {
|
||||
rbtversion = rbtdb->current_version;
|
||||
}
|
||||
@@ -1933,7 +1936,7 @@ getnsec3parameters(dns_db_t *db, dns_dbversion_t *version, dns_hash_t *hash,
|
||||
}
|
||||
result = ISC_R_SUCCESS;
|
||||
}
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
|
||||
return (result);
|
||||
}
|
||||
@@ -1950,7 +1953,7 @@ getsize(dns_db_t *db, dns_dbversion_t *version, uint64_t *records,
|
||||
REQUIRE(VALID_RBTDB(rbtdb));
|
||||
INSIST(rbtversion == NULL || rbtversion->rbtdb == rbtdb);
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
if (rbtversion == NULL) {
|
||||
rbtversion = rbtdb->current_version;
|
||||
}
|
||||
@@ -1960,7 +1963,7 @@ getsize(dns_db_t *db, dns_dbversion_t *version, uint64_t *records,
|
||||
|
||||
SET_IF_NOT_NULL(xfrsize, rbtversion->xfrsize);
|
||||
RWUNLOCK(&rbtversion->rwlock, isc_rwlocktype_read);
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
|
||||
return (result);
|
||||
}
|
||||
@@ -1978,7 +1981,7 @@ setsigningtime(dns_db_t *db, dns_rdataset_t *rdataset, isc_stdtime_t resign) {
|
||||
|
||||
header = dns_slabheader_fromrdataset(rdataset);
|
||||
|
||||
NODE_WRLOCK(&rbtdb->node_locks[HEADER_NODE(header)->locknum].lock,
|
||||
NODE_WRLOCK(&rbtdb->node_locks[RBTDB_HEADERNODE(header)->locknum].lock,
|
||||
&nlocktype);
|
||||
|
||||
oldheader = *header;
|
||||
@@ -1997,25 +2000,25 @@ setsigningtime(dns_db_t *db, dns_rdataset_t *rdataset, isc_stdtime_t resign) {
|
||||
INSIST(RESIGN(header));
|
||||
if (resign == 0) {
|
||||
isc_heap_delete(
|
||||
rbtdb->heaps[HEADER_NODE(header)->locknum],
|
||||
rbtdb->heaps[RBTDB_HEADERNODE(header)->locknum],
|
||||
header->heap_index);
|
||||
header->heap_index = 0;
|
||||
header->heap = NULL;
|
||||
} else if (rbtdb->sooner(header, &oldheader)) {
|
||||
isc_heap_increased(
|
||||
rbtdb->heaps[HEADER_NODE(header)->locknum],
|
||||
rbtdb->heaps[RBTDB_HEADERNODE(header)->locknum],
|
||||
header->heap_index);
|
||||
} else if (rbtdb->sooner(&oldheader, header)) {
|
||||
isc_heap_decreased(
|
||||
rbtdb->heaps[HEADER_NODE(header)->locknum],
|
||||
rbtdb->heaps[RBTDB_HEADERNODE(header)->locknum],
|
||||
header->heap_index);
|
||||
}
|
||||
} else if (resign != 0) {
|
||||
DNS_SLABHEADER_SETATTR(header, DNS_SLABHEADERATTR_RESIGN);
|
||||
dns__zonedb_resigninsert(rbtdb, HEADER_NODE(header)->locknum,
|
||||
header);
|
||||
dns__zonerbt_resigninsert(
|
||||
rbtdb, RBTDB_HEADERNODE(header)->locknum, header);
|
||||
}
|
||||
NODE_UNLOCK(&rbtdb->node_locks[HEADER_NODE(header)->locknum].lock,
|
||||
NODE_UNLOCK(&rbtdb->node_locks[RBTDB_HEADERNODE(header)->locknum].lock,
|
||||
&nlocktype);
|
||||
return (ISC_R_SUCCESS);
|
||||
}
|
||||
@@ -2083,12 +2086,12 @@ getsigningtime(dns_db_t *db, dns_rdataset_t *rdataset,
|
||||
* Found something; pass back the answer and unlock
|
||||
* the bucket.
|
||||
*/
|
||||
dns__rbtdb_bindrdataset(rbtdb, HEADER_NODE(header), header, 0,
|
||||
isc_rwlocktype_read,
|
||||
dns__rbtdb_bindrdataset(rbtdb, RBTDB_HEADERNODE(header), header,
|
||||
0, isc_rwlocktype_read,
|
||||
rdataset DNS__DB_FLARG_PASS);
|
||||
|
||||
if (foundname != NULL) {
|
||||
dns_rbt_fullnamefromnode(HEADER_NODE(header),
|
||||
dns_rbt_fullnamefromnode(RBTDB_HEADERNODE(header),
|
||||
foundname);
|
||||
}
|
||||
|
||||
@@ -2158,12 +2161,12 @@ glue_nsdname_cb(void *arg, const dns_name_t *name, dns_rdatatype_t qtype,
|
||||
dns_rdataset_init(&rdataset_aaaa);
|
||||
dns_rdataset_init(&sigrdataset_aaaa);
|
||||
|
||||
result = zone_find((dns_db_t *)ctx->rbtdb, name, ctx->rbtversion,
|
||||
dns_rdatatype_a, DNS_DBFIND_GLUEOK, 0,
|
||||
(dns_dbnode_t **)&node_a, name_a, &rdataset_a,
|
||||
result = zone_find(ctx->db, name, ctx->version, dns_rdatatype_a,
|
||||
DNS_DBFIND_GLUEOK, 0, (dns_dbnode_t **)&node_a,
|
||||
name_a, &rdataset_a,
|
||||
&sigrdataset_a DNS__DB_FLARG_PASS);
|
||||
if (result == DNS_R_GLUE) {
|
||||
glue = new_gluelist(ctx->rbtdb->common.mctx, name_a);
|
||||
glue = new_gluelist(ctx->db->mctx, name_a);
|
||||
|
||||
dns_rdataset_init(&glue->rdataset_a);
|
||||
dns_rdataset_init(&glue->sigrdataset_a);
|
||||
@@ -2177,14 +2180,13 @@ glue_nsdname_cb(void *arg, const dns_name_t *name, dns_rdatatype_t qtype,
|
||||
}
|
||||
}
|
||||
|
||||
result = zone_find((dns_db_t *)ctx->rbtdb, name, ctx->rbtversion,
|
||||
dns_rdatatype_aaaa, DNS_DBFIND_GLUEOK, 0,
|
||||
(dns_dbnode_t **)&node_aaaa, name_aaaa,
|
||||
&rdataset_aaaa,
|
||||
result = zone_find(ctx->db, name, ctx->version, dns_rdatatype_aaaa,
|
||||
DNS_DBFIND_GLUEOK, 0, (dns_dbnode_t **)&node_aaaa,
|
||||
name_aaaa, &rdataset_aaaa,
|
||||
&sigrdataset_aaaa DNS__DB_FLARG_PASS);
|
||||
if (result == DNS_R_GLUE) {
|
||||
if (glue == NULL) {
|
||||
glue = new_gluelist(ctx->rbtdb->common.mctx, name_aaaa);
|
||||
glue = new_gluelist(ctx->db->mctx, name_aaaa);
|
||||
|
||||
dns_rdataset_init(&glue->rdataset_a);
|
||||
dns_rdataset_init(&glue->sigrdataset_a);
|
||||
@@ -2243,13 +2245,12 @@ glue_nsdname_cb(void *arg, const dns_name_t *name, dns_rdatatype_t qtype,
|
||||
}
|
||||
|
||||
if (node_a != NULL) {
|
||||
dns__db_detachnode((dns_db_t *)ctx->rbtdb,
|
||||
dns__db_detachnode(ctx->db,
|
||||
(dns_dbnode_t *)&node_a DNS__DB_FLARG_PASS);
|
||||
}
|
||||
if (node_aaaa != NULL) {
|
||||
dns__db_detachnode(
|
||||
(dns_db_t *)ctx->rbtdb,
|
||||
(dns_dbnode_t *)&node_aaaa DNS__DB_FLARG_PASS);
|
||||
ctx->db, (dns_dbnode_t *)&node_aaaa DNS__DB_FLARG_PASS);
|
||||
}
|
||||
|
||||
return (result);
|
||||
@@ -2340,8 +2341,8 @@ newglue(dns_rbtdb_t *rbtdb, dns_rbtdb_version_t *rbtversion,
|
||||
dns_rbtnode_t *node, dns_rdataset_t *rdataset) {
|
||||
dns_fixedname_t nodename;
|
||||
dns_glue_additionaldata_ctx_t ctx = {
|
||||
.rbtdb = rbtdb,
|
||||
.rbtversion = rbtversion,
|
||||
.db = (dns_db_t *)rbtdb,
|
||||
.version = (dns_dbversion_t *)rbtversion,
|
||||
.nodename = dns_fixedname_initname(&nodename),
|
||||
};
|
||||
|
||||
@@ -2364,11 +2365,11 @@ addglue(dns_db_t *db, dns_dbversion_t *version, dns_rdataset_t *rdataset,
|
||||
dns_message_t *msg) {
|
||||
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)db;
|
||||
dns_rbtdb_version_t *rbtversion = version;
|
||||
dns_rbtnode_t *node = RDATASET_DBNODE(rdataset);
|
||||
dns_rbtnode_t *node = (dns_rbtnode_t *)rdataset->slab.node;
|
||||
dns_slabheader_t *header = dns_slabheader_fromrdataset(rdataset);
|
||||
|
||||
REQUIRE(rdataset->type == dns_rdatatype_ns);
|
||||
REQUIRE(rbtdb == RDATASET_RBTDB(rdataset));
|
||||
REQUIRE(rbtdb == (dns_rbtdb_t *)rdataset->slab.db);
|
||||
REQUIRE(rbtdb == rbtversion->rbtdb);
|
||||
REQUIRE(!IS_CACHE(rbtdb) && !IS_STUB(rbtdb));
|
||||
|
||||
@@ -2450,8 +2451,8 @@ dns_dbmethods_t dns__rbtdb_zonemethods = {
|
||||
};
|
||||
|
||||
void
|
||||
dns__zonedb_resigninsert(dns_rbtdb_t *rbtdb, int idx,
|
||||
dns_slabheader_t *newheader) {
|
||||
dns__zonerbt_resigninsert(dns_rbtdb_t *rbtdb, int idx,
|
||||
dns_slabheader_t *newheader) {
|
||||
INSIST(!IS_CACHE(rbtdb));
|
||||
INSIST(newheader->heap_index == 0);
|
||||
INSIST(!ISC_LINK_LINKED(newheader, link));
|
||||
@@ -2461,18 +2462,18 @@ dns__zonedb_resigninsert(dns_rbtdb_t *rbtdb, int idx,
|
||||
}
|
||||
|
||||
void
|
||||
dns__zonedb_resigndelete(dns_rbtdb_t *rbtdb, dns_rbtdb_version_t *version,
|
||||
dns_slabheader_t *header DNS__DB_FLARG) {
|
||||
dns__zonerbt_resigndelete(dns_rbtdb_t *rbtdb, dns_rbtdb_version_t *version,
|
||||
dns_slabheader_t *header DNS__DB_FLARG) {
|
||||
/*
|
||||
* Remove the old header from the heap
|
||||
*/
|
||||
if (header != NULL && header->heap_index != 0) {
|
||||
isc_heap_delete(rbtdb->heaps[HEADER_NODE(header)->locknum],
|
||||
isc_heap_delete(rbtdb->heaps[RBTDB_HEADERNODE(header)->locknum],
|
||||
header->heap_index);
|
||||
header->heap_index = 0;
|
||||
if (version != NULL) {
|
||||
dns__rbtdb_newref(
|
||||
rbtdb, HEADER_NODE(header),
|
||||
rbtdb, RBTDB_HEADERNODE(header),
|
||||
isc_rwlocktype_write DNS__DB_FLARG_PASS);
|
||||
ISC_LIST_APPEND(version->resigned_list, header, link);
|
||||
}
|
||||
@@ -2480,8 +2481,8 @@ dns__zonedb_resigndelete(dns_rbtdb_t *rbtdb, dns_rbtdb_version_t *version,
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns__zonedb_wildcardmagic(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
bool lock) {
|
||||
dns__zonerbt_wildcardmagic(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
bool lock) {
|
||||
isc_result_t result;
|
||||
dns_name_t foundname;
|
||||
dns_offsets_t offsets;
|
||||
@@ -2513,8 +2514,8 @@ dns__zonedb_wildcardmagic(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
dns__zonedb_addwildcards(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
bool lock) {
|
||||
dns__zonerbt_addwildcards(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
bool lock) {
|
||||
isc_result_t result;
|
||||
dns_name_t foundname;
|
||||
dns_offsets_t offsets;
|
||||
@@ -2528,8 +2529,8 @@ dns__zonedb_addwildcards(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
dns_rbtnode_t *node = NULL;
|
||||
dns_name_getlabelsequence(name, n - i, i, &foundname);
|
||||
if (dns_name_iswildcard(&foundname)) {
|
||||
result = dns__zonedb_wildcardmagic(rbtdb, &foundname,
|
||||
lock);
|
||||
result = dns__zonerbt_wildcardmagic(rbtdb, &foundname,
|
||||
lock);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
return (result);
|
||||
}
|
||||
|
||||
155
lib/dns/rbtdb.c
155
lib/dns/rbtdb.c
@@ -61,6 +61,7 @@
|
||||
#include <dns/zone.h>
|
||||
#include <dns/zonekey.h>
|
||||
|
||||
#include "db_p.h"
|
||||
#include "rbtdb_p.h"
|
||||
|
||||
#define CHECK(op) \
|
||||
@@ -137,7 +138,7 @@
|
||||
* The default value should work well for most environments, but this can
|
||||
* also be configurable at compilation time via the
|
||||
* DNS_RBTDB_CACHE_NODE_LOCK_COUNT variable. This value must be larger than
|
||||
* 1 due to the assumption of dns__cachedb_overmem().
|
||||
* 1 due to the assumption of dns__cacherbt_overmem().
|
||||
*/
|
||||
#ifdef DNS_RBTDB_CACHE_NODE_LOCK_COUNT
|
||||
#if DNS_RBTDB_CACHE_NODE_LOCK_COUNT <= 1
|
||||
@@ -359,7 +360,7 @@ resign_sooner(void *v1, void *v2) {
|
||||
return (h1->resign < h2->resign ||
|
||||
(h1->resign == h2->resign && h1->resign_lsb < h2->resign_lsb) ||
|
||||
(h1->resign == h2->resign && h1->resign_lsb == h2->resign_lsb &&
|
||||
h2->type == RBTDB_RDATATYPE_SIGSOA));
|
||||
h2->type == DNS_SIGTYPE(dns_rdatatype_soa)));
|
||||
}
|
||||
|
||||
/*%
|
||||
@@ -566,14 +567,14 @@ free_rbtdb(dns_rbtdb_t *rbtdb, bool log) {
|
||||
}
|
||||
|
||||
isc_mem_cput(rbtdb->common.mctx, rbtdb->node_locks,
|
||||
rbtdb->node_lock_count, sizeof(rbtdb_nodelock_t));
|
||||
rbtdb->node_lock_count, sizeof(db_nodelock_t));
|
||||
TREE_DESTROYLOCK(&rbtdb->tree_lock);
|
||||
isc_refcount_destroy(&rbtdb->common.references);
|
||||
if (rbtdb->loop != NULL) {
|
||||
isc_loop_detach(&rbtdb->loop);
|
||||
}
|
||||
|
||||
RBTDB_DESTROYLOCK(&rbtdb->lock);
|
||||
isc_rwlock_destroy(&rbtdb->lock);
|
||||
rbtdb->common.magic = 0;
|
||||
rbtdb->common.impmagic = 0;
|
||||
isc_mem_detach(&rbtdb->hmctx);
|
||||
@@ -626,12 +627,12 @@ dns__rbtdb_destroy(dns_db_t *arg) {
|
||||
}
|
||||
|
||||
if (inactive != 0) {
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
rbtdb->active -= inactive;
|
||||
if (rbtdb->active == 0) {
|
||||
want_free = true;
|
||||
}
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
if (want_free) {
|
||||
char buf[DNS_NAME_FORMATSIZE];
|
||||
if (dns_name_dynamic(&rbtdb->common.origin)) {
|
||||
@@ -655,10 +656,10 @@ dns__rbtdb_currentversion(dns_db_t *db, dns_dbversion_t **versionp) {
|
||||
|
||||
REQUIRE(VALID_RBTDB(rbtdb));
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
version = rbtdb->current_version;
|
||||
isc_refcount_increment(&version->references);
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
|
||||
*versionp = (dns_dbversion_t *)version;
|
||||
}
|
||||
@@ -691,7 +692,7 @@ dns__rbtdb_newversion(dns_db_t *db, dns_dbversion_t **versionp) {
|
||||
REQUIRE(versionp != NULL && *versionp == NULL);
|
||||
REQUIRE(rbtdb->future_version == NULL);
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RUNTIME_CHECK(rbtdb->next_serial != 0); /* XXX Error? */
|
||||
version = allocate_version(rbtdb->common.mctx, rbtdb->next_serial, 1,
|
||||
true);
|
||||
@@ -720,7 +721,7 @@ dns__rbtdb_newversion(dns_db_t *db, dns_dbversion_t **versionp) {
|
||||
RWUNLOCK(&rbtdb->current_version->rwlock, isc_rwlocktype_read);
|
||||
rbtdb->next_serial++;
|
||||
rbtdb->future_version = version;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
|
||||
*versionp = version;
|
||||
|
||||
@@ -754,7 +755,7 @@ add_changed(dns_slabheader_t *header,
|
||||
|
||||
changed = isc_mem_get(rbtdb->common.mctx, sizeof(*changed));
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
|
||||
REQUIRE(version->writer);
|
||||
|
||||
@@ -775,7 +776,7 @@ add_changed(dns_slabheader_t *header,
|
||||
version->commit_ok = false;
|
||||
}
|
||||
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
|
||||
return (changed);
|
||||
}
|
||||
@@ -847,7 +848,7 @@ static void
|
||||
mark_ancient(dns_slabheader_t *header) {
|
||||
dns__rbtdb_setttl(header, 0);
|
||||
dns__rbtdb_mark(header, DNS_SLABHEADERATTR_ANCIENT);
|
||||
HEADER_NODE(header)->dirty = 1;
|
||||
RBTDB_HEADERNODE(header)->dirty = 1;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1151,8 +1152,8 @@ is_leaf(dns_rbtnode_t *node) {
|
||||
static void
|
||||
send_to_prune_tree(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
|
||||
isc_rwlocktype_t locktype DNS__DB_FLARG) {
|
||||
prune_t *prune = isc_mem_get(rbtdb->common.mctx, sizeof(*prune));
|
||||
*prune = (prune_t){ .node = node };
|
||||
db_prune_t *prune = isc_mem_get(rbtdb->common.mctx, sizeof(*prune));
|
||||
*prune = (db_prune_t){ .node = node };
|
||||
|
||||
dns_db_attach((dns_db_t *)rbtdb, &prune->db);
|
||||
dns__rbtdb_newref(rbtdb, node, locktype DNS__DB_FLARG_PASS);
|
||||
@@ -1287,7 +1288,7 @@ dns__rbtdb_decref(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
|
||||
isc_result_t result;
|
||||
bool locked = *tlocktypep != isc_rwlocktype_none;
|
||||
bool write_locked = false;
|
||||
rbtdb_nodelock_t *nodelock = NULL;
|
||||
db_nodelock_t *nodelock = NULL;
|
||||
int bucket = node->locknum;
|
||||
bool no_reference = true;
|
||||
uint_fast32_t refs;
|
||||
@@ -1351,9 +1352,9 @@ dns__rbtdb_decref(dns_rbtdb_t *rbtdb, dns_rbtnode_t *node,
|
||||
* Caller doesn't know the least serial.
|
||||
* Get it.
|
||||
*/
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
least_serial = rbtdb->least_serial;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
}
|
||||
clean_zone_node(node, least_serial);
|
||||
}
|
||||
@@ -1463,7 +1464,7 @@ restore_locks:
|
||||
*/
|
||||
static void
|
||||
prune_tree(void *arg) {
|
||||
prune_t *prune = (prune_t *)arg;
|
||||
db_prune_t *prune = (db_prune_t *)arg;
|
||||
dns_rbtdb_t *rbtdb = (dns_rbtdb_t *)prune->db;
|
||||
dns_rbtnode_t *node = prune->node;
|
||||
dns_rbtnode_t *parent = NULL;
|
||||
@@ -1756,9 +1757,9 @@ dns__rbtdb_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||
if (isc_refcount_decrement(&version->references) > 1) {
|
||||
/* typical and easy case first */
|
||||
if (commit) {
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
INSIST(!version->writer);
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
}
|
||||
goto end;
|
||||
}
|
||||
@@ -1771,7 +1772,7 @@ dns__rbtdb_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||
dns__rbtdb_setsecure(db, version, rbtdb->origin_node);
|
||||
}
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
serial = version->serial;
|
||||
if (version->writer) {
|
||||
if (commit) {
|
||||
@@ -1906,7 +1907,7 @@ dns__rbtdb_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||
UNLINK(rbtdb->open_versions, version, link);
|
||||
}
|
||||
least_serial = rbtdb->least_serial;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
|
||||
if (cleanup_version != NULL) {
|
||||
isc_refcount_destroy(&cleanup_version->references);
|
||||
@@ -1930,13 +1931,15 @@ dns__rbtdb_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||
|
||||
ISC_LIST_UNLINK(resigned_list, header, link);
|
||||
|
||||
lock = &rbtdb->node_locks[HEADER_NODE(header)->locknum].lock;
|
||||
lock = &rbtdb->node_locks[RBTDB_HEADERNODE(header)->locknum]
|
||||
.lock;
|
||||
NODE_WRLOCK(lock, &nlocktype);
|
||||
if (rollback && !IGNORE(header)) {
|
||||
dns__zonedb_resigninsert(
|
||||
rbtdb, HEADER_NODE(header)->locknum, header);
|
||||
dns__zonerbt_resigninsert(
|
||||
rbtdb, RBTDB_HEADERNODE(header)->locknum,
|
||||
header);
|
||||
}
|
||||
dns__rbtdb_decref(rbtdb, HEADER_NODE(header), least_serial,
|
||||
dns__rbtdb_decref(rbtdb, RBTDB_HEADERNODE(header), least_serial,
|
||||
&nlocktype, &tlocktype, true,
|
||||
false DNS__DB_FLARG_PASS);
|
||||
NODE_UNLOCK(lock, &nlocktype);
|
||||
@@ -2039,10 +2042,10 @@ dns__rbtdb_findnodeintree(dns_rbtdb_t *rbtdb, dns_rbt_t *tree,
|
||||
dns_rbt_namefromnode(node, &nodename);
|
||||
node->locknum = node->hashval % rbtdb->node_lock_count;
|
||||
if (tree == rbtdb->tree) {
|
||||
dns__zonedb_addwildcards(rbtdb, name, true);
|
||||
dns__zonerbt_addwildcards(rbtdb, name, true);
|
||||
|
||||
if (dns_name_iswildcard(name)) {
|
||||
result = dns__zonedb_wildcardmagic(
|
||||
result = dns__zonerbt_wildcardmagic(
|
||||
rbtdb, name, true);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
goto unlock;
|
||||
@@ -2222,7 +2225,7 @@ dns__rbtdb_detachnode(dns_db_t *db, dns_dbnode_t **targetp DNS__DB_FLARG) {
|
||||
dns_rbtnode_t *node = NULL;
|
||||
bool want_free = false;
|
||||
bool inactive = false;
|
||||
rbtdb_nodelock_t *nodelock = NULL;
|
||||
db_nodelock_t *nodelock = NULL;
|
||||
isc_rwlocktype_t nlocktype = isc_rwlocktype_none;
|
||||
isc_rwlocktype_t tlocktype = isc_rwlocktype_none;
|
||||
|
||||
@@ -2250,12 +2253,12 @@ dns__rbtdb_detachnode(dns_db_t *db, dns_dbnode_t **targetp DNS__DB_FLARG) {
|
||||
*targetp = NULL;
|
||||
|
||||
if (inactive) {
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
rbtdb->active--;
|
||||
if (rbtdb->active == 0) {
|
||||
want_free = true;
|
||||
}
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
if (want_free) {
|
||||
char buf[DNS_NAME_FORMATSIZE];
|
||||
if (dns_name_dynamic(&rbtdb->common.origin)) {
|
||||
@@ -2569,8 +2572,7 @@ dns__rbtdb_add(dns_rbtdb_t *rbtdb, dns_rbtnode_t *rbtnode,
|
||||
for (topheader = rbtnode->data; topheader != NULL;
|
||||
topheader = topheader->next)
|
||||
{
|
||||
if ((topheader->type ==
|
||||
RBTDB_RDATATYPE_NCACHEANY) ||
|
||||
if ((topheader->type == RDATATYPE_NCACHEANY) ||
|
||||
(newheader->type == sigtype &&
|
||||
topheader->type ==
|
||||
DNS_TYPEPAIR_VALUE(0, covers)))
|
||||
@@ -2797,7 +2799,7 @@ find_header:
|
||||
(header->type == dns_rdatatype_a ||
|
||||
header->type == dns_rdatatype_aaaa ||
|
||||
header->type == dns_rdatatype_ds ||
|
||||
header->type == RBTDB_RDATATYPE_SIGDS) &&
|
||||
header->type == DNS_SIGTYPE(dns_rdatatype_ds)) &&
|
||||
!header_nx && !newheader_nx &&
|
||||
header->trust >= newheader->trust &&
|
||||
dns_rdataslab_equal((unsigned char *)header,
|
||||
@@ -2836,7 +2838,7 @@ find_header:
|
||||
rbtversion->serial >= topheader->serial);
|
||||
if (loading) {
|
||||
newheader->down = NULL;
|
||||
idx = HEADER_NODE(newheader)->locknum;
|
||||
idx = RBTDB_HEADERNODE(newheader)->locknum;
|
||||
if (IS_CACHE(rbtdb)) {
|
||||
if (ZEROTTL(newheader)) {
|
||||
ISC_LIST_APPEND(rbtdb->lru[idx],
|
||||
@@ -2849,7 +2851,8 @@ find_header:
|
||||
isc_heap_insert(rbtdb->heaps[idx], newheader);
|
||||
newheader->heap = rbtdb->heaps[idx];
|
||||
} else if (RESIGN(newheader)) {
|
||||
dns__zonedb_resigninsert(rbtdb, idx, newheader);
|
||||
dns__zonerbt_resigninsert(rbtdb, idx,
|
||||
newheader);
|
||||
/*
|
||||
* Don't call resigndelete, we don't need
|
||||
* to reverse the delete. The free_slabheader
|
||||
@@ -2876,7 +2879,7 @@ find_header:
|
||||
}
|
||||
dns_slabheader_destroy(&header);
|
||||
} else {
|
||||
idx = HEADER_NODE(newheader)->locknum;
|
||||
idx = RBTDB_HEADERNODE(newheader)->locknum;
|
||||
if (IS_CACHE(rbtdb)) {
|
||||
INSIST(rbtdb->heaps != NULL);
|
||||
isc_heap_insert(rbtdb->heaps[idx], newheader);
|
||||
@@ -2889,8 +2892,9 @@ find_header:
|
||||
newheader, link);
|
||||
}
|
||||
} else if (RESIGN(newheader)) {
|
||||
dns__zonedb_resigninsert(rbtdb, idx, newheader);
|
||||
dns__zonedb_resigndelete(
|
||||
dns__zonerbt_resigninsert(rbtdb, idx,
|
||||
newheader);
|
||||
dns__zonerbt_resigndelete(
|
||||
rbtdb, rbtversion,
|
||||
header DNS__DB_FLARG_PASS);
|
||||
}
|
||||
@@ -2932,7 +2936,7 @@ find_header:
|
||||
return (DNS_R_UNCHANGED);
|
||||
}
|
||||
|
||||
idx = HEADER_NODE(newheader)->locknum;
|
||||
idx = RBTDB_HEADERNODE(newheader)->locknum;
|
||||
if (IS_CACHE(rbtdb)) {
|
||||
isc_heap_insert(rbtdb->heaps[idx], newheader);
|
||||
newheader->heap = rbtdb->heaps[idx];
|
||||
@@ -2944,9 +2948,9 @@ find_header:
|
||||
link);
|
||||
}
|
||||
} else if (RESIGN(newheader)) {
|
||||
dns__zonedb_resigninsert(rbtdb, idx, newheader);
|
||||
dns__zonedb_resigndelete(rbtdb, rbtversion,
|
||||
header DNS__DB_FLARG_PASS);
|
||||
dns__zonerbt_resigninsert(rbtdb, idx, newheader);
|
||||
dns__zonerbt_resigndelete(rbtdb, rbtversion,
|
||||
header DNS__DB_FLARG_PASS);
|
||||
}
|
||||
|
||||
if (topheader != NULL) {
|
||||
@@ -3027,7 +3031,7 @@ static isc_result_t
|
||||
addnoqname(isc_mem_t *mctx, dns_slabheader_t *newheader,
|
||||
dns_rdataset_t *rdataset) {
|
||||
isc_result_t result;
|
||||
dns_proof_t *noqname = NULL;
|
||||
dns_slabheader_proof_t *noqname = NULL;
|
||||
dns_name_t name = DNS_NAME_INITEMPTY;
|
||||
dns_rdataset_t neg = DNS_RDATASET_INIT, negsig = DNS_RDATASET_INIT;
|
||||
isc_region_t r1, r2;
|
||||
@@ -3046,7 +3050,7 @@ addnoqname(isc_mem_t *mctx, dns_slabheader_t *newheader,
|
||||
}
|
||||
|
||||
noqname = isc_mem_get(mctx, sizeof(*noqname));
|
||||
*noqname = (dns_proof_t){
|
||||
*noqname = (dns_slabheader_proof_t){
|
||||
.neg = r1.base,
|
||||
.negsig = r2.base,
|
||||
.type = neg.type,
|
||||
@@ -3066,7 +3070,7 @@ static isc_result_t
|
||||
addclosest(isc_mem_t *mctx, dns_slabheader_t *newheader,
|
||||
dns_rdataset_t *rdataset) {
|
||||
isc_result_t result;
|
||||
dns_proof_t *closest = NULL;
|
||||
dns_slabheader_proof_t *closest = NULL;
|
||||
dns_name_t name = DNS_NAME_INITEMPTY;
|
||||
dns_rdataset_t neg = DNS_RDATASET_INIT, negsig = DNS_RDATASET_INIT;
|
||||
isc_region_t r1, r2;
|
||||
@@ -3085,7 +3089,7 @@ addclosest(isc_mem_t *mctx, dns_slabheader_t *newheader,
|
||||
}
|
||||
|
||||
closest = isc_mem_get(mctx, sizeof(*closest));
|
||||
*closest = (dns_proof_t){
|
||||
*closest = (dns_slabheader_proof_t){
|
||||
.neg = r1.base,
|
||||
.negsig = r2.base,
|
||||
.name = DNS_NAME_INITEMPTY,
|
||||
@@ -3263,8 +3267,8 @@ dns__rbtdb_addrdataset(dns_db_t *db, dns_dbnode_t *node,
|
||||
}
|
||||
|
||||
if (cache_is_overmem) {
|
||||
dns__cachedb_overmem(rbtdb, newheader, rbtnode->locknum,
|
||||
&tlocktype DNS__DB_FLARG_PASS);
|
||||
dns__cacherbt_overmem(rbtdb, newheader, rbtnode->locknum,
|
||||
&tlocktype DNS__DB_FLARG_PASS);
|
||||
}
|
||||
|
||||
NODE_WRLOCK(&rbtdb->node_locks[rbtnode->locknum].lock, &nlocktype);
|
||||
@@ -3286,7 +3290,7 @@ dns__rbtdb_addrdataset(dns_db_t *db, dns_dbnode_t *node,
|
||||
if (header != NULL && header->ttl + STALE_TTL(header, rbtdb) <
|
||||
now - RBTDB_VIRTUAL)
|
||||
{
|
||||
dns__cachedb_expireheader(
|
||||
dns__cacherbt_expireheader(
|
||||
header, &tlocktype,
|
||||
dns_expire_ttl DNS__DB_FLARG_PASS);
|
||||
}
|
||||
@@ -3466,7 +3470,7 @@ dns__rbtdb_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
||||
newheader, DNS_SLABHEADERATTR_RESIGN);
|
||||
newheader->resign = header->resign;
|
||||
newheader->resign_lsb = header->resign_lsb;
|
||||
dns__zonedb_resigninsert(
|
||||
dns__zonerbt_resigninsert(
|
||||
rbtdb, rbtnode->locknum, newheader);
|
||||
}
|
||||
/*
|
||||
@@ -3517,8 +3521,8 @@ dns__rbtdb_subtractrdataset(dns_db_t *db, dns_dbnode_t *node,
|
||||
topheader->next = newheader;
|
||||
rbtnode->dirty = 1;
|
||||
changed->dirty = true;
|
||||
dns__zonedb_resigndelete(rbtdb, rbtversion,
|
||||
header DNS__DB_FLARG_PASS);
|
||||
dns__zonerbt_resigndelete(rbtdb, rbtversion,
|
||||
header DNS__DB_FLARG_PASS);
|
||||
} else {
|
||||
/*
|
||||
* The rdataset doesn't exist, so we don't need to do anything
|
||||
@@ -3554,9 +3558,9 @@ unlock:
|
||||
* this is deferred until dns__rbtdb_closeversion() is called.
|
||||
*/
|
||||
if (result == ISC_R_SUCCESS && version == NULL && !IS_CACHE(rbtdb)) {
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
version = rbtdb->current_version;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
dns__rbtdb_setsecure(db, version, rbtdb->origin_node);
|
||||
}
|
||||
|
||||
@@ -3607,9 +3611,9 @@ dns__rbtdb_deleterdataset(dns_db_t *db, dns_dbnode_t *node,
|
||||
* this is deferred until dns__rbtdb_closeversion() is called.
|
||||
*/
|
||||
if (result == ISC_R_SUCCESS && version == NULL && !IS_CACHE(rbtdb)) {
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
version = rbtdb->current_version;
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_read);
|
||||
dns__rbtdb_setsecure(db, version, rbtdb->origin_node);
|
||||
}
|
||||
|
||||
@@ -3624,7 +3628,7 @@ delete_callback(void *data, void *arg) {
|
||||
isc_rwlocktype_t nlocktype = isc_rwlocktype_none;
|
||||
|
||||
current = data;
|
||||
locknum = HEADER_NODE(current)->locknum;
|
||||
locknum = RBTDB_HEADERNODE(current)->locknum;
|
||||
NODE_WRLOCK(&rbtdb->node_locks[locknum].lock, &nlocktype);
|
||||
while (current != NULL) {
|
||||
next = current->next;
|
||||
@@ -3671,14 +3675,14 @@ dns__rbtdb_setloop(dns_db_t *db, isc_loop_t *loop) {
|
||||
|
||||
REQUIRE(VALID_RBTDB(rbtdb));
|
||||
|
||||
RBTDB_LOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
if (rbtdb->loop != NULL) {
|
||||
isc_loop_detach(&rbtdb->loop);
|
||||
}
|
||||
if (loop != NULL) {
|
||||
isc_loop_attach(loop, &rbtdb->loop);
|
||||
}
|
||||
RBTDB_UNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
RWUNLOCK(&rbtdb->lock, isc_rwlocktype_write);
|
||||
}
|
||||
|
||||
isc_result_t
|
||||
@@ -3777,7 +3781,7 @@ dns__rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
|
||||
rbtdb->common.methods = &dns__rbtdb_zonemethods;
|
||||
}
|
||||
|
||||
RBTDB_INITLOCK(&rbtdb->lock);
|
||||
isc_rwlock_init(&rbtdb->lock);
|
||||
TREE_INITLOCK(&rbtdb->tree_lock);
|
||||
|
||||
/*
|
||||
@@ -3798,7 +3802,7 @@ dns__rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
|
||||
}
|
||||
INSIST(rbtdb->node_lock_count < (1 << DNS_RBT_LOCKLENGTH));
|
||||
rbtdb->node_locks = isc_mem_get(mctx, rbtdb->node_lock_count *
|
||||
sizeof(rbtdb_nodelock_t));
|
||||
sizeof(db_nodelock_t));
|
||||
|
||||
rbtdb->common.update_listeners = cds_lfht_new(16, 16, 0, 0, NULL);
|
||||
|
||||
@@ -3957,7 +3961,7 @@ dns__rbtdb_create(isc_mem_t *mctx, const dns_name_t *origin, dns_dbtype_t type,
|
||||
|
||||
cleanup_tree_lock:
|
||||
TREE_DESTROYLOCK(&rbtdb->tree_lock);
|
||||
RBTDB_DESTROYLOCK(&rbtdb->lock);
|
||||
isc_rwlock_destroy(&rbtdb->lock);
|
||||
isc_mem_put(mctx, rbtdb, sizeof(*rbtdb));
|
||||
return (result);
|
||||
}
|
||||
@@ -4682,23 +4686,6 @@ free_gluetable(dns_rbtdb_version_t *rbtversion) {
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
static void
|
||||
free_proof(isc_mem_t *mctx, dns_proof_t **noqname) {
|
||||
if (dns_name_dynamic(&(*noqname)->name)) {
|
||||
dns_name_free(&(*noqname)->name, mctx);
|
||||
}
|
||||
if ((*noqname)->neg != NULL) {
|
||||
isc_mem_put(mctx, (*noqname)->neg,
|
||||
dns_rdataslab_size((*noqname)->neg, 0));
|
||||
}
|
||||
if ((*noqname)->negsig != NULL) {
|
||||
isc_mem_put(mctx, (*noqname)->negsig,
|
||||
dns_rdataslab_size((*noqname)->negsig, 0));
|
||||
}
|
||||
isc_mem_put(mctx, *noqname, sizeof(**noqname));
|
||||
*noqname = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
dns__rbtdb_deletedata(dns_db_t *db ISC_ATTR_UNUSED,
|
||||
dns_dbnode_t *node ISC_ATTR_UNUSED, void *data) {
|
||||
@@ -4716,16 +4703,16 @@ dns__rbtdb_deletedata(dns_db_t *db ISC_ATTR_UNUSED,
|
||||
false);
|
||||
|
||||
if (ISC_LINK_LINKED(header, link)) {
|
||||
int idx = HEADER_NODE(header)->locknum;
|
||||
int idx = RBTDB_HEADERNODE(header)->locknum;
|
||||
INSIST(IS_CACHE(rbtdb));
|
||||
ISC_LIST_UNLINK(rbtdb->lru[idx], header, link);
|
||||
}
|
||||
|
||||
if (header->noqname != NULL) {
|
||||
free_proof(db->mctx, &header->noqname);
|
||||
dns_slabheader_freeproof(db->mctx, &header->noqname);
|
||||
}
|
||||
if (header->closest != NULL) {
|
||||
free_proof(db->mctx, &header->closest);
|
||||
dns_slabheader_freeproof(db->mctx, &header->closest);
|
||||
}
|
||||
} else {
|
||||
if (header->glue_list) {
|
||||
|
||||
@@ -29,124 +29,7 @@
|
||||
#define VALID_RBTDB(rbtdb) \
|
||||
((rbtdb) != NULL && (rbtdb)->common.impmagic == RBTDB_MAGIC)
|
||||
|
||||
#define RBTDB_RDATATYPE_SIGNSEC \
|
||||
DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, dns_rdatatype_nsec)
|
||||
#define RBTDB_RDATATYPE_SIGNSEC3 \
|
||||
DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, dns_rdatatype_nsec3)
|
||||
#define RBTDB_RDATATYPE_SIGNS \
|
||||
DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, dns_rdatatype_ns)
|
||||
#define RBTDB_RDATATYPE_SIGCNAME \
|
||||
DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, dns_rdatatype_cname)
|
||||
#define RBTDB_RDATATYPE_SIGDNAME \
|
||||
DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, dns_rdatatype_dname)
|
||||
#define RBTDB_RDATATYPE_SIGDS \
|
||||
DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, dns_rdatatype_ds)
|
||||
#define RBTDB_RDATATYPE_SIGSOA \
|
||||
DNS_TYPEPAIR_VALUE(dns_rdatatype_rrsig, dns_rdatatype_soa)
|
||||
#define RBTDB_RDATATYPE_NCACHEANY DNS_TYPEPAIR_VALUE(0, dns_rdatatype_any)
|
||||
|
||||
#define RBTDB_INITLOCK(l) isc_rwlock_init((l))
|
||||
#define RBTDB_DESTROYLOCK(l) isc_rwlock_destroy(l)
|
||||
#define RBTDB_LOCK(l, t) RWLOCK((l), (t))
|
||||
#define RBTDB_UNLOCK(l, t) RWUNLOCK((l), (t))
|
||||
|
||||
#ifdef DNS_RBTDB_STRONG_RWLOCK_CHECK
|
||||
#define STRONG_RWLOCK_CHECK(cond) REQUIRE(cond)
|
||||
#else
|
||||
#define STRONG_RWLOCK_CHECK(cond)
|
||||
#endif
|
||||
|
||||
#define NODE_INITLOCK(l) isc_rwlock_init((l))
|
||||
#define NODE_DESTROYLOCK(l) isc_rwlock_destroy(l)
|
||||
#define NODE_LOCK(l, t, tp) \
|
||||
{ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
|
||||
RWLOCK((l), (t)); \
|
||||
*tp = t; \
|
||||
}
|
||||
#define NODE_UNLOCK(l, tp) \
|
||||
{ \
|
||||
STRONG_RWLOCK_CHECK(*tp != isc_rwlocktype_none); \
|
||||
RWUNLOCK(l, *tp); \
|
||||
*tp = isc_rwlocktype_none; \
|
||||
}
|
||||
#define NODE_RDLOCK(l, tp) NODE_LOCK(l, isc_rwlocktype_read, tp);
|
||||
#define NODE_WRLOCK(l, tp) NODE_LOCK(l, isc_rwlocktype_write, tp);
|
||||
#define NODE_TRYLOCK(l, t, tp) \
|
||||
({ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
|
||||
isc_result_t _result = isc_rwlock_trylock(l, t); \
|
||||
if (_result == ISC_R_SUCCESS) { \
|
||||
*tp = t; \
|
||||
}; \
|
||||
_result; \
|
||||
})
|
||||
#define NODE_TRYRDLOCK(l, tp) NODE_TRYLOCK(l, isc_rwlocktype_read, tp)
|
||||
#define NODE_TRYWRLOCK(l, tp) NODE_TRYLOCK(l, isc_rwlocktype_write, tp)
|
||||
#define NODE_TRYUPGRADE(l, tp) \
|
||||
({ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_read); \
|
||||
isc_result_t _result = isc_rwlock_tryupgrade(l); \
|
||||
if (_result == ISC_R_SUCCESS) { \
|
||||
*tp = isc_rwlocktype_write; \
|
||||
}; \
|
||||
_result; \
|
||||
})
|
||||
#define NODE_FORCEUPGRADE(l, tp) \
|
||||
if (NODE_TRYUPGRADE(l, tp) != ISC_R_SUCCESS) { \
|
||||
NODE_UNLOCK(l, tp); \
|
||||
NODE_WRLOCK(l, tp); \
|
||||
}
|
||||
|
||||
#define TREE_INITLOCK(l) isc_rwlock_init(l)
|
||||
#define TREE_DESTROYLOCK(l) isc_rwlock_destroy(l)
|
||||
#define TREE_LOCK(l, t, tp) \
|
||||
{ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
|
||||
RWLOCK(l, t); \
|
||||
*tp = t; \
|
||||
}
|
||||
#define TREE_UNLOCK(l, tp) \
|
||||
{ \
|
||||
STRONG_RWLOCK_CHECK(*tp != isc_rwlocktype_none); \
|
||||
RWUNLOCK(l, *tp); \
|
||||
*tp = isc_rwlocktype_none; \
|
||||
}
|
||||
#define TREE_RDLOCK(l, tp) TREE_LOCK(l, isc_rwlocktype_read, tp);
|
||||
#define TREE_WRLOCK(l, tp) TREE_LOCK(l, isc_rwlocktype_write, tp);
|
||||
#define TREE_TRYLOCK(l, t, tp) \
|
||||
({ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_none); \
|
||||
isc_result_t _result = isc_rwlock_trylock(l, t); \
|
||||
if (_result == ISC_R_SUCCESS) { \
|
||||
*tp = t; \
|
||||
}; \
|
||||
_result; \
|
||||
})
|
||||
#define TREE_TRYRDLOCK(l, tp) TREE_TRYLOCK(l, isc_rwlocktype_read, tp)
|
||||
#define TREE_TRYWRLOCK(l, tp) TREE_TRYLOCK(l, isc_rwlocktype_write, tp)
|
||||
#define TREE_TRYUPGRADE(l, tp) \
|
||||
({ \
|
||||
STRONG_RWLOCK_CHECK(*tp == isc_rwlocktype_read); \
|
||||
isc_result_t _result = isc_rwlock_tryupgrade(l); \
|
||||
if (_result == ISC_R_SUCCESS) { \
|
||||
*tp = isc_rwlocktype_write; \
|
||||
}; \
|
||||
_result; \
|
||||
})
|
||||
#define TREE_FORCEUPGRADE(l, tp) \
|
||||
if (TREE_TRYUPGRADE(l, tp) != ISC_R_SUCCESS) { \
|
||||
TREE_UNLOCK(l, tp); \
|
||||
TREE_WRLOCK(l, tp); \
|
||||
}
|
||||
|
||||
#define RDATASET_RBTDB(r) ((dns_rbtdb_t *)(r)->slab.db)
|
||||
#define RDATASET_DBNODE(r) ((dns_rbtnode_t *)(r)->slab.node)
|
||||
|
||||
#define HEADER_NODE(h) ((dns_rbtnode_t *)((h)->node))
|
||||
|
||||
#define IS_STUB(rbtdb) (((rbtdb)->common.attributes & DNS_DBATTR_STUB) != 0)
|
||||
#define IS_CACHE(rbtdb) (((rbtdb)->common.attributes & DNS_DBATTR_CACHE) != 0)
|
||||
#define RBTDB_HEADERNODE(h) ((dns_rbtnode_t *)((h)->node))
|
||||
|
||||
/*
|
||||
* Allow clients with a virtual time of up to 5 minutes in the past to see
|
||||
@@ -165,14 +48,6 @@
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
typedef struct {
|
||||
isc_rwlock_t lock;
|
||||
/* Protected in the refcount routines. */
|
||||
isc_refcount_t references;
|
||||
/* Locked by lock. */
|
||||
bool exiting;
|
||||
} rbtdb_nodelock_t;
|
||||
|
||||
typedef struct rbtdb_changed {
|
||||
dns_rbtnode_t *node;
|
||||
bool dirty;
|
||||
@@ -181,25 +56,6 @@ typedef struct rbtdb_changed {
|
||||
|
||||
typedef ISC_LIST(rbtdb_changed_t) rbtdb_changedlist_t;
|
||||
|
||||
struct dns_glue {
|
||||
struct dns_glue *next;
|
||||
dns_fixedname_t fixedname;
|
||||
dns_rdataset_t rdataset_a;
|
||||
dns_rdataset_t sigrdataset_a;
|
||||
dns_rdataset_t rdataset_aaaa;
|
||||
dns_rdataset_t sigrdataset_aaaa;
|
||||
|
||||
isc_mem_t *mctx;
|
||||
struct rcu_head rcu_head;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
dns_glue_t *glue_list;
|
||||
dns_rbtdb_t *rbtdb;
|
||||
dns_rbtdb_version_t *rbtversion;
|
||||
dns_name_t *nodename;
|
||||
} dns_glue_additionaldata_ctx_t;
|
||||
|
||||
struct dns_rbtdb_version {
|
||||
/* Not locked */
|
||||
uint32_t serial;
|
||||
@@ -246,7 +102,7 @@ struct dns_rbtdb {
|
||||
isc_rwlock_t tree_lock;
|
||||
/* Locks for individual tree nodes */
|
||||
unsigned int node_lock_count;
|
||||
rbtdb_nodelock_t *node_locks;
|
||||
db_nodelock_t *node_locks;
|
||||
dns_rbtnode_t *origin_node;
|
||||
dns_rbtnode_t *nsec3_origin_node;
|
||||
dns_stats_t *rrsetstats; /* cache DB only */
|
||||
@@ -323,22 +179,6 @@ typedef struct {
|
||||
isc_stdtime_t now;
|
||||
} rbtdb_search_t;
|
||||
|
||||
/*%
|
||||
* Load Context
|
||||
*/
|
||||
typedef struct {
|
||||
dns_rbtdb_t *rbtdb;
|
||||
isc_stdtime_t now;
|
||||
} rbtdb_load_t;
|
||||
|
||||
/*%
|
||||
* Prune context
|
||||
*/
|
||||
typedef struct {
|
||||
dns_db_t *db;
|
||||
dns_rbtnode_t *node;
|
||||
} prune_t;
|
||||
|
||||
extern dns_dbmethods_t dns__rbtdb_zonemethods;
|
||||
extern dns_dbmethods_t dns__rbtdb_cachemethods;
|
||||
|
||||
@@ -564,18 +404,18 @@ dns__rbtdb_setttl(dns_slabheader_t *header, dns_ttl_t newttl);
|
||||
* Functions specific to zone databases that are also called from rbtdb.c.
|
||||
*/
|
||||
void
|
||||
dns__zonedb_resigninsert(dns_rbtdb_t *rbtdb, int idx,
|
||||
dns_slabheader_t *newheader);
|
||||
dns__zonerbt_resigninsert(dns_rbtdb_t *rbtdb, int idx,
|
||||
dns_slabheader_t *newheader);
|
||||
void
|
||||
dns__zonedb_resigndelete(dns_rbtdb_t *rbtdb, dns_rbtdb_version_t *version,
|
||||
dns_slabheader_t *header DNS__DB_FLARG);
|
||||
dns__zonerbt_resigndelete(dns_rbtdb_t *rbtdb, dns_rbtdb_version_t *version,
|
||||
dns_slabheader_t *header DNS__DB_FLARG);
|
||||
/*%<
|
||||
* Insert/delete a node from the zone database's resigning heap.
|
||||
*/
|
||||
|
||||
isc_result_t
|
||||
dns__zonedb_wildcardmagic(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
bool lock);
|
||||
dns__zonerbt_wildcardmagic(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
bool lock);
|
||||
/*%<
|
||||
* Add the necessary magic for the wildcard name 'name'
|
||||
* to be found in 'rbtdb'.
|
||||
@@ -592,7 +432,8 @@ dns__zonedb_wildcardmagic(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
* The tree must be write-locked.
|
||||
*/
|
||||
isc_result_t
|
||||
dns__zonedb_addwildcards(dns_rbtdb_t *rbtdb, const dns_name_t *name, bool lock);
|
||||
dns__zonerbt_addwildcards(dns_rbtdb_t *rbtdb, const dns_name_t *name,
|
||||
bool lock);
|
||||
/*%<
|
||||
* If 'name' is or contains a wildcard name, create a node for it in the
|
||||
* database. The tree must be write-locked.
|
||||
@@ -602,12 +443,12 @@ dns__zonedb_addwildcards(dns_rbtdb_t *rbtdb, const dns_name_t *name, bool lock);
|
||||
* Cache-specific functions that are called from rbtdb.c
|
||||
*/
|
||||
void
|
||||
dns__cachedb_expireheader(dns_slabheader_t *header,
|
||||
isc_rwlocktype_t *tlocktypep,
|
||||
dns_expire_t reason DNS__DB_FLARG);
|
||||
dns__cacherbt_expireheader(dns_slabheader_t *header,
|
||||
isc_rwlocktype_t *tlocktypep,
|
||||
dns_expire_t reason DNS__DB_FLARG);
|
||||
void
|
||||
dns__cachedb_overmem(dns_rbtdb_t *rbtdb, dns_slabheader_t *newheader,
|
||||
unsigned int locknum_start,
|
||||
isc_rwlocktype_t *tlocktypep DNS__DB_FLARG);
|
||||
dns__cacherbt_overmem(dns_rbtdb_t *rbtdb, dns_slabheader_t *newheader,
|
||||
unsigned int locknum_start,
|
||||
isc_rwlocktype_t *tlocktypep DNS__DB_FLARG);
|
||||
|
||||
ISC_LANG_ENDDECLS
|
||||
|
||||
@@ -89,23 +89,6 @@ struct xrdata {
|
||||
#endif /* if DNS_RDATASET_FIXED */
|
||||
};
|
||||
|
||||
struct dns_glue {
|
||||
struct dns_glue *next;
|
||||
dns_fixedname_t fixedname;
|
||||
dns_rdataset_t rdataset_a;
|
||||
dns_rdataset_t sigrdataset_a;
|
||||
dns_rdataset_t rdataset_aaaa;
|
||||
dns_rdataset_t sigrdataset_aaaa;
|
||||
struct cds_wfs_node wfs_node;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
dns_glue_t *glue_list;
|
||||
dns_rbtdb_t *rbtdb;
|
||||
dns_rbtdb_version_t *rbtversion;
|
||||
dns_name_t *nodename;
|
||||
} dns_glue_additionaldata_ctx_t;
|
||||
|
||||
static void
|
||||
rdataset_disassociate(dns_rdataset_t *rdataset DNS__DB_FLARG);
|
||||
static isc_result_t
|
||||
@@ -1160,6 +1143,23 @@ dns_slabheader_destroy(dns_slabheader_t **headerp) {
|
||||
isc_mem_put(mctx, header, size);
|
||||
}
|
||||
|
||||
void
|
||||
dns_slabheader_freeproof(isc_mem_t *mctx, dns_slabheader_proof_t **proof) {
|
||||
if (dns_name_dynamic(&(*proof)->name)) {
|
||||
dns_name_free(&(*proof)->name, mctx);
|
||||
}
|
||||
if ((*proof)->neg != NULL) {
|
||||
isc_mem_put(mctx, (*proof)->neg,
|
||||
dns_rdataslab_size((*proof)->neg, 0));
|
||||
}
|
||||
if ((*proof)->negsig != NULL) {
|
||||
isc_mem_put(mctx, (*proof)->negsig,
|
||||
dns_rdataslab_size((*proof)->negsig, 0));
|
||||
}
|
||||
isc_mem_put(mctx, *proof, sizeof(**proof));
|
||||
*proof = NULL;
|
||||
}
|
||||
|
||||
dns_rdatasetmethods_t dns_rdataslab_rdatasetmethods = {
|
||||
.disassociate = rdataset_disassociate,
|
||||
.first = rdataset_first,
|
||||
@@ -1331,7 +1331,7 @@ rdataset_getnoqname(dns_rdataset_t *rdataset, dns_name_t *name,
|
||||
dns_rdataset_t *nsecsig DNS__DB_FLARG) {
|
||||
dns_db_t *db = rdataset->slab.db;
|
||||
dns_dbnode_t *node = rdataset->slab.node;
|
||||
const dns_proof_t *noqname = rdataset->slab.noqname;
|
||||
const dns_slabheader_proof_t *noqname = rdataset->slab.noqname;
|
||||
|
||||
/*
|
||||
* Usually, rdataset->slab.raw refers the data following a
|
||||
@@ -1387,7 +1387,7 @@ rdataset_getclosest(dns_rdataset_t *rdataset, dns_name_t *name,
|
||||
dns_rdataset_t *nsecsig DNS__DB_FLARG) {
|
||||
dns_db_t *db = rdataset->slab.db;
|
||||
dns_dbnode_t *node = rdataset->slab.node;
|
||||
const dns_proof_t *closest = rdataset->slab.closest;
|
||||
const dns_slabheader_proof_t *closest = rdataset->slab.closest;
|
||||
|
||||
/*
|
||||
* As mentioned above, rdataset->slab.raw usually refers the data
|
||||
|
||||
@@ -96,7 +96,7 @@ const char *ownercase_vectors[12][2] = {
|
||||
static bool
|
||||
ownercase_test_one(const char *str1, const char *str2) {
|
||||
isc_result_t result;
|
||||
rbtdb_nodelock_t node_locks[1];
|
||||
db_nodelock_t node_locks[1];
|
||||
dns_rbtdb_t rbtdb = {
|
||||
.common.methods = &dns__rbtdb_zonemethods,
|
||||
.common.mctx = mctx,
|
||||
@@ -163,7 +163,7 @@ ISC_RUN_TEST_IMPL(ownercase) {
|
||||
|
||||
ISC_RUN_TEST_IMPL(setownercase) {
|
||||
isc_result_t result;
|
||||
rbtdb_nodelock_t node_locks[1];
|
||||
db_nodelock_t node_locks[1];
|
||||
dns_rbtdb_t rbtdb = {
|
||||
.common.methods = &dns__rbtdb_zonemethods,
|
||||
.common.mctx = mctx,
|
||||
|
||||
Reference in New Issue
Block a user