dns_dbversion_t **versionp, bool *is_zonep)
{
isc_result_t result;
-
isc_result_t tresult;
unsigned int namelabels;
unsigned int zonelabels;
dbp, versionp);
/* See how many labels are in the zone's name. */
- if (result == ISC_R_SUCCESS && zone != NULL)
+ if (result == ISC_R_SUCCESS && zone != NULL) {
zonelabels = dns_name_countlabels(dns_zone_getorigin(zone));
+ }
/*
* If # zone labels < # name labels, try to find an even better match
* If neither attempt above succeeded, return the cache instead
*/
*is_zonep = true;
- } else if (result == ISC_R_NOTFOUND) {
- result = query_getcachedb(client, name, qtype, dbp, options);
+ } else {
+ if (result == ISC_R_NOTFOUND) {
+ result = query_getcachedb(client, name, qtype, dbp,
+ options);
+ }
*is_zonep = false;
}
return (result);
CTRACE(ISC_LOG_DEBUG(3), "redirect2");
- if (client->view->redirectzone == NULL)
+ if (client->view->redirectzone == NULL) {
return (ISC_R_NOTFOUND);
+ }
- if (dns_name_issubdomain(name, client->view->redirectzone))
+ if (dns_name_issubdomain(name, client->view->redirectzone)) {
return (ISC_R_NOTFOUND);
+ }
found = dns_fixedname_initname(&fixed);
dns_rdataset_init(&trdataset);
dns_clientinfomethods_init(&cm, ns_client_sourceip);
dns_clientinfo_init(&ci, client, NULL);
- if (WANTDNSSEC(client) && dns_db_iszone(*dbp) && dns_db_issecure(*dbp))
+ if (WANTDNSSEC(client) && dns_db_iszone(*dbp) && dns_db_issecure(*dbp)) {
return (ISC_R_NOTFOUND);
+ }
if (WANTDNSSEC(client) && dns_rdataset_isassociated(rdataset)) {
if (rdataset->trust == dns_trust_secure)
redirectname, NULL);
if (result != ISC_R_SUCCESS)
return (ISC_R_NOTFOUND);
- } else
+ } else {
dns_name_copy(redirectname, client->view->redirectzone, NULL);
+ }
options = 0;
result = query_getdb(client, redirectname, qtype, options, &zone,
&db, &version, &is_zone);
- if (result != ISC_R_SUCCESS)
+ if (result != ISC_R_SUCCESS) {
return (ISC_R_NOTFOUND);
- if (zone != NULL)
+ }
+ if (zone != NULL) {
dns_zone_detach(&zone);
+ }
/*
* Lookup the requested data in the redirect zone.
return (query_done(qctx));
}
}
-
return (query_gotanswer(qctx, result));
}
RESTORE(qctx->zone, qctx->client->query.redirect.zone);
qctx->authoritative =
qctx->client->query.redirect.authoritative;
- qctx->is_zone = qctx->client->query.redirect.is_zone;
/*
* Free resources used while recursing.
ISC_EVENT_PTR(&qctx->event), &qctx->event);
} else if (REDIRECT(qctx->client)) {
result = qctx->client->query.redirect.result;
- qctx->is_zone = qctx->client->query.redirect.is_zone;
} else {
result = qctx->event->result;
}