dns_db_detach((dns_db_t **)(void *)&bdb);
}
-static isc_result_t
-getoriginnode(dns_db_t *db, dns_dbnode_t **nodep DNS__DB_FLARG) {
- bdb_t *bdb = (bdb_t *)db;
- bdbnode_t *node = NULL;
- isc_result_t result;
- dns_name_t relname;
- dns_name_t *name = NULL;
-
- REQUIRE(VALID_BDB(bdb));
- REQUIRE(nodep != NULL && *nodep == NULL);
-
- dns_name_init(&relname);
- name = &relname;
-
- result = createnode(bdb, &node);
- if (result != ISC_R_SUCCESS) {
- return result;
- }
-
- result = builtin_lookup(bdb, name, node);
- if (result != ISC_R_SUCCESS && result != ISC_R_NOTFOUND) {
- destroynode(node);
- return result;
- }
-
- result = builtin_authority(bdb, node);
- if (result != ISC_R_SUCCESS) {
- destroynode(node);
- return result;
- }
-
- *nodep = (dns_dbnode_t *)node;
- return ISC_R_SUCCESS;
-}
-
static isc_result_t
findnode(dns_db_t *db, const dns_name_t *name, bool create,
dns_clientinfomethods_t *methods ISC_ATTR_UNUSED,
.closeversion = closeversion,
.findrdataset = findrdataset,
.allrdatasets = allrdatasets,
- .getoriginnode = getoriginnode,
.findnode = findnode,
.find = find,
};
if (db->methods->getoriginnode != NULL) {
return (db->methods->getoriginnode)(db,
nodep DNS__DB_FLARG_PASS);
+ } else if (db->methods->findnode != NULL) {
+ return (db->methods->findnode)(db, &db->origin, false, NULL,
+ NULL, nodep DNS__DB_FLARG_PASS);
}
return ISC_R_NOTFOUND;
return result;
}
-/*
- * getoriginnode() is used by the update code to find the
- * dns_rdatatype_dnskey record for a zone
- */
-static isc_result_t
-getoriginnode(dns_db_t *db, dns_dbnode_t **nodep DNS__DB_FLARG) {
- dns_sdlz_db_t *sdlz = (dns_sdlz_db_t *)db;
- isc_result_t result;
-
- REQUIRE(VALID_SDLZDB(sdlz));
- if (sdlz->dlzimp->methods->newversion == NULL) {
- return ISC_R_NOTIMPLEMENTED;
- }
-
- result = getnodedata(db, &sdlz->common.origin, false, 0, NULL, NULL,
- nodep);
- if (result != ISC_R_SUCCESS) {
- sdlz_log(ISC_LOG_ERROR, "sdlz getoriginnode failed: %s",
- isc_result_totext(result));
- }
- return result;
-}
-
static dns_dbmethods_t sdlzdb_methods = {
.destroy = destroy,
.currentversion = currentversion,
.addrdataset = addrdataset,
.subtractrdataset = subtractrdataset,
.deleterdataset = deleterdataset,
- .getoriginnode = getoriginnode,
};
/*