]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
rename `DNS_DBFIND_NOEXACT` to `DNS_DBFIND_ABOVE`
authorColin Vidal <colin@isc.org>
Mon, 13 Apr 2026 08:31:44 +0000 (10:31 +0200)
committerColin Vidal <colin@isc.org>
Thu, 16 Apr 2026 09:28:13 +0000 (11:28 +0200)
The `DNS_DBFIND_NOEXACT` flag name is ambiguous, as it does not clearly
indicate the lookup behavior (e.g., sibling, child, or parent).

Rename it to `DNS_DBFIND_ABOVE` to better reflect that the lookup
targets a closer ancestor name.

lib/dns/deleg.c
lib/dns/include/dns/db.h
lib/dns/include/dns/view.h
lib/dns/resolver.c
lib/dns/view.c
tests/dns/deleg_test.c

index 92ee3f1a8f109f78e10139d2d1a3ccafc1474463..708f53ad04974d99054c78b04056436ae22370c6 100644 (file)
@@ -295,7 +295,7 @@ dns__deleg_lookup(dns_delegdb_t *delegdb, dns_qpread_t *qpr,
        isc_stdtime_t now = optnow > 0 ? optnow : isc_stdtime_now();
 
        dns_qpchain_t chain = {};
-       bool noexact = (options & DNS_DBFIND_NOEXACT) != 0;
+       bool above = (options & DNS_DBFIND_ABOVE) != 0;
 
        REQUIRE(VALID_DELEGDB(delegdb));
        REQUIRE(DNS_NAME_VALID(name));
@@ -316,7 +316,7 @@ dns__deleg_lookup(dns_delegdb_t *delegdb, dns_qpread_t *qpr,
 
        /*
         * Walk up the chain when:
-        *  - we have an exact match but the caller asked for NOEXACT
+        *  - we have an exact match but the caller asked for DNS_DBFIND_ABOVE
         *    (i.e. the caller wants the deepest *proper* ancestor), or
         *  - the matched node is no longer active and we need to fall
         *    back to the closest still-active ancestor (this applies
@@ -326,7 +326,7 @@ dns__deleg_lookup(dns_delegdb_t *delegdb, dns_qpread_t *qpr,
         * exists in the chain, so we must NULL-check before dereferencing
         * 'node' below.
         */
-       if ((result == ISC_R_SUCCESS && noexact) || !isactive(node, now)) {
+       if ((result == ISC_R_SUCCESS && above) || !isactive(node, now)) {
                getparentnode(&chain, &node, now);
        }
 
index bd8fca23d14008ff6d2d4f3baf2bde4ae4722efb..83ea893d293016ab5c834182ff5af7cc2b2583bd 100644 (file)
@@ -251,7 +251,7 @@ enum {
        DNS_DBFIND_GLUEOK = 1 << 0,
        DNS_DBFIND_NOWILD = 1 << 1,
        DNS_DBFIND_PENDINGOK = 1 << 2,
-       DNS_DBFIND_NOEXACT = 1 << 3,
+       DNS_DBFIND_ABOVE = 1 << 3,
        DNS_DBFIND_COVERINGNSEC = 1 << 4,
        DNS_DBFIND_FORCENSEC3 = 1 << 5,
        DNS_DBFIND_ADDITIONALOK = 1 << 6,
index 740ed2496c5e0d51e3e3b0238b1120999ca7bf09..e8c0af78b1c8ac88957894eac16b9ad4ca342554 100644 (file)
@@ -711,7 +711,7 @@ dns_view_bestzonecut(dns_view_t *view, const dns_name_t *name,
  *\li  If 'use_cache' is true, and the view has a cache, then it will be
  *     searched.
  *
- *\li  If the DNS_DBFIND_NOEXACT option is set, then the zonecut returned
+ *\li  If the DNS_DBFIND_ABOVE option is set, then the zonecut returned
  *     (if any) will be the deepest known ancestor of 'name'.
  *
  *\li  If dcname is not NULL the deepest cached name is copied to it.
index 65da6ae1554a0fea9a4d16f9ebdd7a6f4a8dcece..454df5a5a3fa8560f8c8dd1bff4b2eca84a15aae 100644 (file)
@@ -4626,7 +4626,7 @@ resume_qmin(void *arg) {
        dns_delegset_detach(&fctx->delegset);
 
        if (dns_rdatatype_atparent(fctx->type)) {
-               findoptions |= DNS_DBFIND_NOEXACT;
+               findoptions |= DNS_DBFIND_ABOVE;
        }
        result = dns_view_bestzonecut(res->view, fctx->name, fname, dcname,
                                      fctx->now, findoptions, true, true,
@@ -5064,7 +5064,7 @@ fctx__create(dns_resolver_t *res, isc_loop_t *loop, const dns_name_t *name,
                         * mode, so find the best nameservers to use.
                         */
                        if (dns_rdatatype_atparent(fctx->type)) {
-                               findoptions |= DNS_DBFIND_NOEXACT;
+                               findoptions |= DNS_DBFIND_ABOVE;
                        }
                        result = dns_view_bestzonecut(
                                res->view, name, fctx->fwdname, dcname,
@@ -9372,7 +9372,7 @@ rctx_nextserver(respctx_t *rctx, dns_message_t *message,
                        return;
                }
                if (dns_rdatatype_atparent(fctx->type)) {
-                       findoptions |= DNS_DBFIND_NOEXACT;
+                       findoptions |= DNS_DBFIND_ABOVE;
                }
                /* FIXME: Why??? */
                if ((rctx->retryopts & DNS_FETCHOPT_UNSHARED) == 0) {
index 1637131a6cafced67ceab1cf3ade0a1de6926138..a73c55756c6a5f1cf0543d7597673b2f62ce615a 100644 (file)
@@ -997,7 +997,7 @@ bestzonecut_zone(dns_view_t *view, const dns_name_t *name, dns_name_t *fname,
        unsigned int ztoptions = DNS_ZTFIND_MIRROR;
        isc_result_t result;
 
-       if ((options & DNS_DBFIND_NOEXACT) != 0) {
+       if ((options & DNS_DBFIND_ABOVE) != 0) {
                ztoptions |= DNS_ZTFIND_NOEXACT;
        }
 
index 8082b670914621c3fe643e4e58d2fe2e2b89f8c2..d3af6aba966210f5515fa903435c17447727114d 100644 (file)
@@ -448,8 +448,8 @@ noexacttests(ISC_ATTR_UNUSED void *arg) {
                dns_delegset_detach(&delegset);
 
                result = lookupdb(db, zonecuts[i].name, now + 1,
-                                 DNS_DBFIND_NOEXACT,
-                                 zonecuts[i].noexactexpected, &delegset);
+                                 DNS_DBFIND_ABOVE, zonecuts[i].noexactexpected,
+                                 &delegset);
                assert_int_equal(result, zonecuts[i].noexactresult);
                if (result == ISC_R_SUCCESS) {
                        dns_delegset_detach(&delegset);