domain, &nameservers, NULL, NULL, 0, 0, 0, NULL, NULL,
NULL, tat->loop, tat_done, tat, NULL, &tat->rdataset,
&tat->sigrdataset, &tat->fetch);
+
+ /*
+ * dns_resolver_createfetch() will create its own copy of
+ * nameservers.
+ */
+ dns_rdataset_cleanup(&nameservers);
}
/*
* 'domain' holds the dns_name_t pointer inside a dst_key_t structure.
* dns_resolver_createfetch() creates its own copy of 'domain' if it
* succeeds. Thus, 'domain' is not freed here.
- *
- * Even if dns_view_findzonecut() returned something else than
- * ISC_R_SUCCESS, it still could have associated 'nameservers'.
- * dns_resolver_createfetch() creates its own copy of 'nameservers' if
- * it succeeds. Thus, we need to check whether 'nameservers' is
- * associated and release it if it is.
*/
- dns_rdataset_cleanup(&nameservers);
if (result != ISC_R_SUCCESS) {
dns_view_detach(&tat->view);
DP(ENTER_LEVEL, "fetch_name: starting at zone for name %p",
adbname);
name = dns_fixedname_initname(&fixed);
- result = dns_view_findzonecut(adb->view, adbname->name, name,
- NULL, 0, 0, true, false,
- &rdataset, NULL);
- if (result != ISC_R_SUCCESS && result != DNS_R_HINT) {
- goto cleanup;
- }
+ CHECK(dns_view_findzonecut(adb->view, adbname->name, name, NULL,
+ 0, 0, true, false, &rdataset, NULL));
nameservers = &rdataset;
options |= DNS_FETCHOPT_UNSHARED;
} else if (adb->view->qminimization) {
*
* Returns:
*
- *\li #ISC_R_SUCCESS Success.
- *
- *\li Many other results are possible.
+ *\li #ISC_R_SUCCESS If a delegation is found;
+ *\li #DNS_R_NXDOMAIN If no delegation is found; 'rdataset' and 'sigrdataset'
+ * are disassociated.
*/
isc_result_t
&fctx->nameservers, NULL);
FCTXTRACEN("resume_qmin findzonecut", fname, result);
- /*
- * DNS_R_NXDOMAIN here means we have not loaded the root zone
- * mirror yet - but DNS_R_NXDOMAIN is not a valid return value
- * when doing recursion, we need to patch it.
- *
- * CNAME or DNAME means zone were added with that record
- * after the start of a recursion. It means we do not have
- * initialized correct hevent->foundname and have to fail.
- */
- if (result == DNS_R_NXDOMAIN || result == DNS_R_CNAME ||
- result == DNS_R_DNAME)
- {
- result = DNS_R_SERVFAIL;
- }
-
if (result != ISC_R_SUCCESS) {
+ result = DNS_R_SERVFAIL;
goto cleanup;
}
fcount_decr(fctx);