rdclass = dst_key_class(key);
name = dns_fixedname_initname(&fixed);
- result = dns_name_copy(dst_key_name(key), name, NULL);
- if (result != ISC_R_SUCCESS)
- fatal("can't copy name");
+ RUNTIME_CHECK(dns_name_copy(dst_key_name(key), name, NULL) == ISC_R_SUCCESS);
dst_key_free(&key);
}
rdclass = dst_key_class(key);
name = dns_fixedname_initname(&fixed);
- result = dns_name_copy(dst_key_name(key), name, NULL);
- if (result != ISC_R_SUCCESS)
- fatal("can't copy name");
+ RUNTIME_CHECK(dns_name_copy(dst_key_name(key), name, NULL) == ISC_R_SUCCESS);
dst_key_free(&key);
}
dns_fixedname_init(&fname);
if (usezone) {
- result = dns_name_copy(dns_zone_getorigin(zone),
- dns_fixedname_name(&fname),
- NULL);
- if (result != ISC_R_SUCCESS) {
- cfg_obj_log(identity, named_g_lctx,
- ISC_LOG_ERROR,
- "error copying origin: %s",
- isc_result_totext(result));
- goto cleanup;
- }
+ RUNTIME_CHECK(dns_name_copy(dns_zone_getorigin(zone), dns_fixedname_name(&fname), NULL) == ISC_R_SUCCESS);
} else {
str = cfg_obj_asstring(dname);
isc_buffer_constinit(&b, str, strlen(str));
/* Reverse zone is managed by this driver, prepare PTR record */
pevent->zone = NULL;
dns_zone_attach(ptr_zone, &pevent->zone);
- result = dns_name_copy(name,
- dns_fixedname_name(&pevent->ptr_target_name),
- NULL);
- if (result != ISC_R_SUCCESS) {
- log_write(ISC_LOG_ERROR,
- "syncptr: dns_name_copy -> %s\n",
- isc_result_totext(result));
- goto cleanup;
- }
+ RUNTIME_CHECK(dns_name_copy(name, dns_fixedname_name(&pevent->ptr_target_name), NULL) == ISC_R_SUCCESS);
dns_name_clone(dns_fixedname_name(&pevent->ptr_target_name),
&ptr_struct.ptr);
dns_diff_init(inst->mctx, &pevent->diff);
find->partial_result |= (adbname->partial_result & wanted_addresses);
if (alias) {
if (target != NULL) {
- result = dns_name_copy(&adbname->target, target, NULL);
- if (result != ISC_R_SUCCESS)
- goto out;
+ RUNTIME_CHECK(dns_name_copy(&adbname->target, target, NULL) == ISC_R_SUCCESS);
}
result = DNS_R_ALIAS;
} else
rctx->sigrdataset = sigrdataset;
dns_fixedname_init(&rctx->name);
- result = dns_name_copy(name, dns_fixedname_name(&rctx->name), NULL);
- if (result != ISC_R_SUCCESS)
- goto cleanup;
+ RUNTIME_CHECK(dns_name_copy(name, dns_fixedname_name(&rctx->name), NULL) == ISC_R_SUCCESS);
rctx->client = client;
ISC_LINK_INIT(rctx, link);
if (uctx->zonename == NULL) {
uctx->zonename = dns_fixedname_name(&uctx->zonefname);
- result = dns_name_copy(soaname, uctx->zonename, NULL);
- if (result != ISC_R_SUCCESS)
- goto out;
+ RUNTIME_CHECK(dns_name_copy(soaname, uctx->zonename, NULL) == ISC_R_SUCCESS);
}
if (uctx->currentserver != NULL)
UNLOCK(&uctx->lock);
}
- out:
dns_rdata_freestruct(&soa);
return (result);
dns_name_init(newname, NULL);
dns_name_setbuffer(newname, namebuf);
dns_message_takebuffer(msg, &namebuf);
- result = dns_name_copy(name, newname, NULL);
- if (result != ISC_R_SUCCESS)
- goto fail;
+ RUNTIME_CHECK(dns_name_copy(name, newname, NULL) == ISC_R_SUCCESS);
for (rdataset = ISC_LIST_HEAD(name->list); rdataset != NULL;
rdataset = ISC_LIST_NEXT(rdataset, link)) {
nodep = &node;
}
rpsdb_findnode(db, name, false, nodep);
- result = dns_name_copy(name, foundname, NULL);
- if (result != ISC_R_SUCCESS)
- return (result);
+ RUNTIME_CHECK(dns_name_copy(name, foundname, NULL) == ISC_R_SUCCESS);
return (rpsdb_findrdataset(db, *nodep, NULL, type, 0, 0,
rdataset, sigrdataset));
}
dns_rdata_reset(&rdata);
if (result != ISC_R_SUCCESS)
break;
- result = dns_name_copy(&cname.cname, name, NULL);
+ RUNTIME_CHECK(dns_name_copy(&cname.cname, name, NULL) == ISC_R_SUCCESS);
dns_rdata_freestruct(&cname);
- if (result == ISC_R_SUCCESS) {
- want_restart = true;
- send_event = false;
- }
+ want_restart = true;
+ send_event = false;
break;
case DNS_R_DNAME:
namereln = dns_name_fullcompare(name, fname, &order,
dns_view_t *view, unsigned int options, isc_task_t *task,
isc_taskaction_t action, void *arg, dns_lookup_t **lookupp)
{
- isc_result_t result;
dns_lookup_t *lookup;
isc_event_t *ievent;
dns_fixedname_init(&lookup->name);
- result = dns_name_copy(name, dns_fixedname_name(&lookup->name), NULL);
- if (result != ISC_R_SUCCESS)
- goto cleanup_lock;
+ RUNTIME_CHECK(dns_name_copy(name, dns_fixedname_name(&lookup->name), NULL) == ISC_R_SUCCESS);
lookup->type = type;
lookup->view = NULL;
lookup_find(lookup, NULL);
return (ISC_R_SUCCESS);
-
- cleanup_lock:
- isc_mutex_destroy(&lookup->lock);
- ievent = (isc_event_t *)lookup->event;
- isc_event_free(&ievent);
- lookup->event = NULL;
-
- isc_task_detach(&lookup->task);
-
- isc_mem_putanddetach(&mctx, lookup, sizeof(*lookup));
-
- return (result);
}
void
if (include_chain_end && chain->end != NULL) {
NODENAME(chain->end, &nodename);
- result = dns_name_copy(&nodename, name, NULL);
- if (result != ISC_R_SUCCESS)
- return (result);
+ RUNTIME_CHECK(dns_name_copy(&nodename, name, NULL) == ISC_R_SUCCESS);
} else
dns_name_reset(name);
dns_name_t *foundname, dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset)
{
- isc_result_t result;
dns_name_t *zcname;
rbtdb_rdatatype_t type;
dns_rbtnode_t *node;
*/
if (foundname != NULL && search->copy_name) {
zcname = dns_fixedname_name(&search->zonecut_name);
- result = dns_name_copy(zcname, foundname, NULL);
- if (result != ISC_R_SUCCESS)
- return (result);
+ RUNTIME_CHECK(dns_name_copy(zcname, foundname, NULL) == ISC_R_SUCCESS);
}
if (nodep != NULL) {
/*
*/
result = find_wildcard(&search, &node, name);
if (result == ISC_R_SUCCESS) {
- result = dns_name_copy(name, foundname, NULL);
- if (result != ISC_R_SUCCESS)
- goto tree_exit;
+ RUNTIME_CHECK(dns_name_copy(name, foundname, NULL) == ISC_R_SUCCESS);
wild = true;
goto found;
}
if (event != NULL) {
adbp = &event->db;
aname = dns_fixedname_name(&event->foundname);
- result = dns_name_copy(name, aname, NULL);
- if (result != ISC_R_SUCCESS) {
- return (result);
- }
+ RUNTIME_CHECK(dns_name_copy(name, aname, NULL) == ISC_R_SUCCESS);
anodep = &event->node;
/*
* If this is an ANY, SIG or RRSIG query, we're not
if (event != NULL) {
adbp = &event->db;
aname = dns_fixedname_name(&event->foundname);
- result = dns_name_copy(name, aname, NULL);
- if (result != ISC_R_SUCCESS)
- goto unlock;
+ RUNTIME_CHECK(dns_name_copy(name, aname, NULL) == ISC_R_SUCCESS);
anodep = &event->node;
ardataset = event->rdataset;
}
dns_rdataset_disassociate(rdataset);
if (foundname != NULL) {
- isc_result_t xresult;
-
- xresult = dns_name_copy(xname, foundname, NULL);
- if (xresult != ISC_R_SUCCESS) {
- if (node != NULL)
- destroynode(node);
- if (dns_rdataset_isassociated(rdataset))
- dns_rdataset_disassociate(rdataset);
- return (DNS_R_BADDB);
- }
+ RUNTIME_CHECK(dns_name_copy(xname, foundname, NULL) == ISC_R_SUCCESS);
}
if (nodep != NULL)
dns_rdataset_disassociate(rdataset);
if (foundname != NULL) {
- isc_result_t xresult;
-
- xresult = dns_name_copy(xname, foundname, NULL);
- if (xresult != ISC_R_SUCCESS) {
- if (node != NULL) {
- detachnode(db, &node);
- }
- if (dns_rdataset_isassociated(rdataset)) {
- dns_rdataset_disassociate(rdataset);
- }
- return (DNS_R_BADDB);
- }
+ RUNTIME_CHECK(dns_name_copy(xname, foundname, NULL) == ISC_R_SUCCESS);
}
if (nodep != NULL)
* We found an answer, but the cache may be better.
*/
zfname = dns_fixedname_name(&zfixedname);
- result = dns_name_copy(fname, zfname, NULL);
- if (result != ISC_R_SUCCESS)
- goto cleanup;
+ RUNTIME_CHECK(dns_name_copy(fname, zfname, NULL) == ISC_R_SUCCESS);
dns_rdataset_clone(rdataset, &zrdataset);
dns_rdataset_disassociate(rdataset);
if (sigrdataset != NULL &&
*/
try_hints = true;
}
+ result = ISC_R_SUCCESS;
} else {
/*
* Something bad happened.
dns_rdataset_isassociated(sigrdataset))
dns_rdataset_disassociate(sigrdataset);
}
- result = dns_name_copy(zfname, fname, NULL);
- if (result != ISC_R_SUCCESS)
- goto cleanup;
+ RUNTIME_CHECK(dns_name_copy(zfname, fname, NULL) == ISC_R_SUCCESS);
if (dcname != NULL) {
- result = dns_name_copy(zfname, dcname, NULL);
- if (result != ISC_R_SUCCESS)
- goto cleanup;
+ RUNTIME_CHECK(dns_name_copy(zfname, dcname, NULL) == ISC_R_SUCCESS);
}
dns_rdataset_clone(&zrdataset, rdataset);
if (sigrdataset != NULL &&
*/
for (i = namelabels; i > minlabels && i > 1; i--) {
if (i == namelabels) {
- result = dns_name_copy(name, zonename, NULL);
- if (result != ISC_R_SUCCESS)
- return (result);
+ RUNTIME_CHECK(dns_name_copy(name, zonename, NULL) == ISC_R_SUCCESS);
} else
dns_name_split(name, i, NULL, zonename);
tname = dns_fixedname_name(&qctx->event->foundname);
}
- result = dns_name_copy(tname, qctx->fname, NULL);
- if (result != ISC_R_SUCCESS) {
- CCTRACE(ISC_LOG_ERROR,
- "query_resume: dns_name_copy failed");
- QUERY_ERROR(qctx, result);
- return (ns_query_done(qctx));
- }
+ RUNTIME_CHECK(dns_name_copy(tname, qctx->fname, NULL) == ISC_R_SUCCESS);
if (qctx->rpz_st != NULL &&
(qctx->rpz_st->state & DNS_RPZ_RECURSING) != 0) {