/*
* Turn off search.
*/
- if (dns_name_countlabels(name) > 1U) {
+ if (dns_name_belowroot(name)) {
strlcat(namebuf, ".", sizeof(namebuf));
}
eai = getaddrinfo(namebuf, NULL, &hints, &ai);
/*
* Turn off search.
*/
- if (dns_name_countlabels(name) > 1U) {
+ if (dns_name_belowroot(name)) {
strlcat(namebuf, ".", sizeof(namebuf));
}
dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
/*
* Turn off search.
*/
- if (dns_name_countlabels(name) > 1U) {
+ if (dns_name_belowroot(name)) {
strlcat(namebuf, ".", sizeof(namebuf));
}
dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
/*
* Turn off search.
*/
- if (dns_name_countlabels(name) > 1U) {
+ if (dns_name_belowroot(name)) {
strlcat(namebuf, ".", sizeof(namebuf));
}
dns_name_format(owner, ownerbuf, sizeof(ownerbuf));
str = cfg_obj_asstring(cfg_tuple_get(rpz_obj, "zone name"));
RETERR(configure_rpz_name(view, rpz_obj, &zone->origin, str, "zone"));
- if (dns_name_equal(&zone->origin, dns_rootname)) {
+ if (dns_name_isroot(&zone->origin)) {
cfg_obj_log(rpz_obj, DNS_RPZ_ERROR_LEVEL,
"invalid zone name '%s'", str);
return DNS_R_EMPTYLABEL;
result = dns_name_fromstring(&origin, str, dns_rootname,
DNS_NAME_DOWNCASE, view->mctx);
- if (result == ISC_R_SUCCESS && dns_name_equal(&origin, dns_rootname)) {
+ if (result == ISC_R_SUCCESS && dns_name_isroot(&origin)) {
result = DNS_R_EMPTYLABEL;
}
"zone '%s': 'file' not specified", zname);
CLEANUP(ISC_R_FAILURE);
}
- if (dns_name_equal(origin, dns_rootname)) {
+ if (dns_name_isroot(origin)) {
const char *hintsfile = cfg_obj_asstring(fileobj);
CHECK(configure_rootdb(view, hintsfile));
* if some of the views share a single cache. But since the
* operation is lightweight we prefer simplicity here.
*/
- if (dns_name_equal(name, dns_rootname)) {
+ if (dns_name_isroot(name)) {
result = dns_view_flushcache(view, false);
} else {
result = dns_view_flushnode(view, name, tree);
CHECK(dns_name_fromtext(dnsname, &buf, dns_rootname, 0));
if (redirect) {
- if (!dns_name_equal(dnsname, dns_rootname)) {
+ if (!dns_name_isroot(dnsname)) {
(void)putstr(text, "redirect zones must be called "
"\".\"");
CLEANUP(ISC_R_FAILURE);
CHECK(dns_name_fromstring(rad, adstr, dns_rootname, 0,
mctx));
- if (logreports || dns_name_equal(rad, dns_rootname)) {
+ if (logreports || dns_name_isroot(rad)) {
/* Disable RC for error-logging zones or root */
dns_zone_setrad(zone, NULL);
} else if (dns_name_equal(rad, zn)) {
* explicitly specified and this is a root zone mirror.
*/
if (obj == NULL && ztype == dns_zone_mirror &&
- dns_name_equal(dns_zone_getorigin(zone), dns_rootname))
+ dns_name_isroot(dns_zone_getorigin(zone)))
{
result = named_config_getremotesdef(
config, "remote-servers",
*/
tmprdataset = ISC_LIST_HEAD(firstname->list);
if (section == DNS_SECTION_UPDATE &&
- !dns_name_equal(firstname, dns_rootname) &&
+ !dns_name_isroot(firstname) &&
tmprdataset->type == dns_rdatatype_ds)
{
unsigned int labels = dns_name_countlabels(name);
dns_dbnode_t *node = NULL;
dns_db_t *db = NULL;
- REQUIRE(!(tree && dns_name_equal(name, dns_rootname)));
+ REQUIRE(!(tree && dns_name_isroot(name)));
LOCK(&cache->lock);
if (cache->db != NULL) {
* must be in the additional data section, and
* it must be the first OPT we've seen.
*/
- if (!dns_name_equal(dns_rootname, name) ||
+ if (!dns_name_isroot(name) ||
sectionid != DNS_SECTION_ADDITIONAL ||
msg->opt != NULL)
{
if (covers == dns_rdatatype_none) {
if (sectionid != DNS_SECTION_ADDITIONAL ||
count != msg->counts[sectionid] - 1 ||
- !dns_name_equal(name, dns_rootname))
+ !dns_name_isroot(name))
{
DO_ERROR(DNS_R_BADSIG0);
} else {
goto return_false;
}
- if (dns_name_compare(origin, dns_rootname) == 0) {
+ if (dns_name_isroot(origin)) {
goto return_false;
}
isc_region_consume(®ion, 5);
dns_name_fromregion(&name, ®ion);
- if (dns_name_equal(&name, dns_rootname)) {
+ if (dns_name_isroot(&name)) {
return ISC_R_SUCCESS;
}
isc_region_consume(®ion, 2);
dns_name_fromregion(&name, ®ion);
- if (dns_name_equal(&name, dns_rootname)) {
+ if (dns_name_isroot(&name)) {
return ISC_R_SUCCESS;
}
UNUSED(rdclass);
UNUSED(wildcard);
- return dns_name_equal(name, dns_rootname);
+ return dns_name_isroot(name);
}
static bool
isc_region_consume(®ion, 2);
dns_name_fromregion(&name, ®ion);
- if (dns_name_equal(&name, dns_rootname)) {
+ if (dns_name_isroot(&name)) {
return ISC_R_SUCCESS;
}
dns_name_fromregion(&name, ®ion);
- if (dns_name_equal(&name, dns_rootname)) {
+ if (dns_name_isroot(&name)) {
/*
* "." only means owner name in service form.
*/
- if (alias || dns_name_equal(owner, dns_rootname) ||
+ if (alias || dns_name_isroot(owner) ||
!dns_name_ishostname(owner, false))
{
return ISC_R_SUCCESS;
* Strip label to get the correct forwarder (if any).
*/
if (dns_rdatatype_atparent(fctx->type) &&
- dns_name_countlabels(name) > 1)
+ dns_name_belowroot(name))
{
unsigned int labels;
dns_name_init(&suffix);
* the forwarder).
*/
if (dns_rdatatype_atparent(fctx->type) &&
- dns_name_countlabels(name) > 1)
+ dns_name_belowroot(name))
{
dns_name_init(&suffix);
labels = dns_name_countlabels(name);
if (rctx->ns_rdataset != NULL &&
dns_name_equal(fctx->domain, rctx->ns_name) &&
- !dns_name_equal(rctx->ns_name, dns_rootname))
+ !dns_name_isroot(rctx->ns_name))
{
trim_ns_ttl(fctx, rctx->ns_name, rctx->ns_rdataset);
}
if (rctx->ns_rdataset != NULL &&
dns_name_equal(fctx->domain, rctx->ns_name) &&
- !dns_name_equal(rctx->ns_name, dns_rootname))
+ !dns_name_isroot(rctx->ns_name))
{
trim_ns_ttl(fctx, rctx->ns_name, rctx->ns_rdataset);
}
rctx->query->rmessage->rcode == dns_rcode_noerror &&
fctx->type == dns_rdatatype_ds && rctx->soa_name != NULL &&
dns_name_equal(rctx->soa_name, fctx->name) &&
- !dns_name_equal(fctx->name, dns_rootname))
+ !dns_name_isroot(fctx->name))
{
return DNS_R_CHASEDSSERVERS;
}
* namespace checks, even if their address info uses the forwarder flag.
*/
if (ISFORWARDER(fctx->addrinfo) && !ISDUALSTACK(fctx->addrinfo) &&
- dns_name_equal(fctx->fwdname, dns_rootname))
+ dns_name_isroot(fctx->fwdname))
{
log_formerr(fctx, "referral from global forwarder");
rctx->result = DNS_R_FORMERR;
case dns_rdatatype_aaaa:
return in_rootns(rootns, name);
case dns_rdatatype_ns:
- if (dns_name_compare(name, dns_rootname) == 0) {
+ if (dns_name_isroot(name)) {
return ISC_R_SUCCESS;
}
FALLTHROUGH;
/*
* CNAME . means NXDOMAIN
*/
- if (dns_name_equal(&cname.cname, dns_rootname)) {
+ if (dns_name_isroot(&cname.cname)) {
return DNS_RPZ_POLICY_NXDOMAIN;
}
case DNS_TKEYMODE_GSSAPI:
keyname = dns_fixedname_initname(&fkeyname);
- if (!dns_name_equal(qname, dns_rootname)) {
+ if (!dns_name_isroot(qname)) {
unsigned int n = dns_name_countlabels(qname);
dns_name_copy(qname, keyname);
dns_name_getlabelsequence(keyname, 0, n - 1, keyname);
* If this is the root name and there was no trust anchor,
* we can give up now, since there's no DS at the root.
*/
- if (dns_name_equal(val->name, dns_rootname)) {
+ if (dns_name_isroot(val->name)) {
if ((val->attributes & VALATTR_TRIEDVERIFY) != 0) {
validator_log(val, ISC_LOG_DEBUG(3),
"root key failed to validate");
/*
* "." means the services does not exist.
*/
- if (dns_name_equal(name, dns_rootname)) {
+ if (dns_name_isroot(name)) {
return true;
}
/*
* "." means the services does not exist.
*/
- if (dns_name_equal(name, dns_rootname)) {
+ if (dns_name_isroot(name)) {
return true;
}
nsfetch = &fetch->fetchdata.nsfetch;
/* Derive parent domain. Check for root domain. */
- if (dns_name_countlabels(&nsfetch->pname) <= 1U) {
+ if (!dns_name_belowroot(&nsfetch->pname)) {
return ISC_R_NOTFOUND;
}
case dns_ssumatchtype_selfwild:
if (tresult == ISC_R_SUCCESS &&
(!dns_name_equal(id, name) &&
- !dns_name_equal(dns_rootname, name)))
+ !dns_name_isroot(name)))
{
cfg_obj_log(identity, ISC_LOG_ERROR,
"identity and name fields are not "
case dns_ssumatchtype_selfsubms:
case dns_ssumatchtype_tcpself:
case dns_ssumatchtype_6to4self:
- if (tresult == ISC_R_SUCCESS &&
- !dns_name_equal(dns_rootname, name))
+ if (tresult == ISC_R_SUCCESS && !dns_name_isroot(name))
{
cfg_obj_log(identity, ISC_LOG_ERROR,
"name field not set to "
if (tresult != ISC_R_SUCCESS) {
result = tresult;
}
- if (dns_name_equal(zname, dns_rootname)) {
+ if (dns_name_isroot(zname)) {
root = true;
} else if (dns_name_isrfc1918(zname)) {
rfc1918 = true;
*/
if (ztype == CFG_ZONE_SECONDARY || ztype == CFG_ZONE_STUB ||
(ztype == CFG_ZONE_MIRROR && zname != NULL &&
- !dns_name_equal(zname, dns_rootname)))
+ !dns_name_isroot(zname)))
{
obj = NULL;
(void)get_zoneopt(zoptions, toptions, NULL, NULL, "primaries",
(void)get_zoneopt(zoptions, toptions, NULL, NULL,
"log-report-channel", &obj);
if (obj != NULL && cfg_obj_asboolean(obj) &&
- dns_name_equal(zname, dns_rootname))
+ dns_name_isroot(zname))
{
cfg_obj_log(zconfig, ISC_LOG_ERROR,
"'log-report-channel' cannot be set in "
}
}
- if (result == ISC_R_SUCCESS &&
- dns_name_equal(keyname, dns_rootname))
- {
+ if (result == ISC_R_SUCCESS && dns_name_isroot(keyname)) {
/*
* Flag any use of a root key, regardless of content.
*/
isc_result_totext(tresult));
result = ISC_R_FAILURE;
}
- if (result == ISC_R_SUCCESS &&
- dns_name_equal(keyname, dns_rootname))
- {
+ if (result == ISC_R_SUCCESS && dns_name_isroot(keyname)) {
/*
* Flag any use of a root key, regardless of content.
*/
isc_mem_free(mctx, p);
}
- if (autovalidation && dns_name_equal(name, dns_rootname)) {
+ if (autovalidation && dns_name_isroot(name)) {
cfg_obj_log(obj, ISC_LOG_ERROR,
"static trust anchor for root zone "
"cannot be used with "
if (dns_name_dynamic(&client->inner.rad)) {
rad = &client->inner.rad;
}
- if (rad != NULL && !dns_name_equal(rad, dns_rootname)) {
+ if (rad != NULL && !dns_name_isroot(rad)) {
dns_ednsopt_t option = {
.code = DNS_OPT_REPORT_CHANNEL,
.length = rad->length,
/*
* Do nothing about "NS ."
*/
- if (dns_name_equal(&ns.name, dns_rootname)) {
+ if (dns_name_isroot(&ns.name)) {
dns_rdata_freestruct(&ns);
result = dns_rdataset_next(st->r.ns_rdataset);
continue;
*/
qctx->options = (dns_getdb_options_t){ .nolog = qctx->options.nolog };
if (dns_rdatatype_atparent(qctx->qtype) &&
- !dns_name_equal(qctx->client->query.qname, dns_rootname))
+ !dns_name_isroot(qctx->client->query.qname))
{
/*
* If authoritative data for this QTYPE is supposed to live in
return ns_query_done(qctx);
}
- if (!dns_name_equal(qctx->client->query.qname, dns_rootname)) {
+ if (!dns_name_isroot(qctx->client->query.qname)) {
result = query_checkrpz(qctx, result);
if (result == ISC_R_NOTFOUND) {
/*
* Always add glue for root priming queries, regardless
* of "minimal-responses" setting.
*/
- if (dns_name_equal(qctx->client->query.qname, dns_rootname)) {
+ if (dns_name_isroot(qctx->client->query.qname)) {
qctx->client->query.noadditional = false;
dns_db_attach(qctx->db, &qctx->client->query.gluedb);
}