]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove `sigrdataset` from `dns_view_findzonecut()`
authorColin Vidal <colin@isc.org>
Fri, 9 Jan 2026 14:47:52 +0000 (15:47 +0100)
committerEvan Hunt <each@isc.org>
Fri, 16 Jan 2026 03:48:30 +0000 (19:48 -0800)
Since the `sigrdataset` "output" parameter of `dns_view_findzonecut()`
is never used (always called with NULL), it is now removed.

Also, since the resolver is moving towards a parent-centric direction,
there is no point having a signature for the NS record (which is not
authoritative in the parent, so never signed) in the contextes where
`dns_view_findzonecut()` is called.

bin/named/server.c
lib/dns/adb.c
lib/dns/include/dns/view.h
lib/dns/resolver.c
lib/dns/validator.c
lib/dns/view.c

index e381a99851f19237a7c54c8406183df8478697e2..d79d36c0cf27bf17c1746e3492ecbed5f0df3981 100644 (file)
@@ -6591,7 +6591,7 @@ tat_send(void *arg) {
        domain = dns_fixedname_initname(&fdomain);
        dns_rdataset_init(&nameservers);
        result = dns_view_findzonecut(tat->view, keyname, domain, NULL, 0, 0,
-                                     true, true, &nameservers, NULL);
+                                     true, true, &nameservers);
        if (result == ISC_R_SUCCESS) {
                result = dns_resolver_createfetch(
                        tat->view->resolver, tatname, dns_rdatatype_null,
index 402c1392f4731680110c544712f78eeb962163cd..d61f1ab4801d390bcee5c3e54393ea63ba161553 100644 (file)
@@ -2739,7 +2739,7 @@ fetch_name(dns_adbname_t *adbname, bool start_at_zone, bool no_validation,
                   adbname);
                name = dns_fixedname_initname(&fixed);
                CHECK(dns_view_findzonecut(adb->view, adbname->name, name, NULL,
-                                          0, 0, true, false, &rdataset, NULL));
+                                          0, 0, true, false, &rdataset));
                nameservers = &rdataset;
                options |= DNS_FETCHOPT_UNSHARED;
        } else if (adb->view->qminimization) {
index d65a0d07852e37e4b5ac9041245fc2e71aef7218..033a1df74b0bfd571c58b94c53ce9452ca007453 100644 (file)
@@ -687,7 +687,7 @@ isc_result_t
 dns_view_findzonecut(dns_view_t *view, const dns_name_t *name,
                     dns_name_t *fname, dns_name_t *dcname, isc_stdtime_t now,
                     unsigned int options, bool use_hints, bool use_cache,
-                    dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
+                    dns_rdataset_t *rdataset);
 /*%<
  * Find the best known zonecut containing 'name'.
  *
@@ -704,9 +704,6 @@ dns_view_findzonecut(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 'sigrdataset' is not NULL, and there is a SIG rdataset which
- *     covers 'type', then 'sigrdataset' will be bound to it.
- *
  *\li  If the DNS_DBFIND_NOEXACT option is set, then the zonecut returned
  *     (if any) will be the deepest known ancestor of 'name'.
  *
index 53174814219744b924840969a07307b46c900744..78f1599cfe8d232aef6453f759d5073aefce5cad 100644 (file)
@@ -4498,7 +4498,7 @@ resume_qmin(void *arg) {
        }
        result = dns_view_findzonecut(res->view, fctx->name, fname, dcname,
                                      fctx->now, findoptions, true, true,
-                                     &fctx->nameservers, NULL);
+                                     &fctx->nameservers);
        FCTXTRACEN("resume_qmin findzonecut", fname, result);
 
        if (result != ISC_R_SUCCESS) {
@@ -4946,7 +4946,7 @@ fctx__create(dns_resolver_t *res, isc_loop_t *loop, const dns_name_t *name,
                        result = dns_view_findzonecut(
                                res->view, name, fctx->fwdname, dcname,
                                fctx->now, findoptions, true, true,
-                               &fctx->nameservers, NULL);
+                               &fctx->nameservers);
                        if (result != ISC_R_SUCCESS) {
                                goto cleanup_nameservers;
                        }
@@ -9219,9 +9219,9 @@ rctx_nextserver(respctx_t *rctx, dns_message_t *message,
                } else {
                        name = fctx->domain;
                }
-               result = dns_view_findzonecut(
-                       fctx->res->view, name, fname, dcname, fctx->now,
-                       findoptions, true, true, &fctx->nameservers, NULL);
+               result = dns_view_findzonecut(fctx->res->view, name, fname,
+                                             dcname, fctx->now, findoptions,
+                                             true, true, &fctx->nameservers);
                if (result != ISC_R_SUCCESS) {
                        FCTXTRACE("couldn't find a zonecut");
                        fctx_failure_detach(&rctx->fctx, DNS_R_SERVFAIL);
index 201f81f069a050f1b7e4f0fe3e9b80375b785006..ef94788c632fdcd62e49324797745ba61106a6c7 100644 (file)
@@ -3235,8 +3235,7 @@ seek_ds(dns_validator_t *val, isc_result_t *resp) {
                if (result == DNS_R_NXRRSET &&
                    !dns_rdataset_isassociated(&val->frdataset) &&
                    dns_view_findzonecut(val->view, tname, found, NULL, 0, 0,
-                                        false, false, NULL,
-                                        NULL) == ISC_R_SUCCESS &&
+                                        false, false, NULL) == ISC_R_SUCCESS &&
                    dns_name_equal(tname, found))
                {
                        *resp = markanswer(val, "seek_ds (2)");
index db8a01ffa07587e4a19b686dbac3e39c9dc083e3..d80f722065991324351707266524d961c76eee4f 100644 (file)
@@ -986,7 +986,7 @@ dns_view_simplefind(dns_view_t *view, const dns_name_t *name,
 static isc_result_t
 findzonecut_zone(dns_view_t *view, const dns_name_t *name, dns_name_t *fname,
                 dns_name_t *dcname, isc_stdtime_t now, unsigned int options,
-                dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset) {
+                dns_rdataset_t *rdataset) {
        dns_db_t *db = NULL;
        dns_zone_t *zone = NULL;
        unsigned int ztoptions = DNS_ZTFIND_MIRROR;
@@ -1016,7 +1016,7 @@ findzonecut_zone(dns_view_t *view, const dns_name_t *name, dns_name_t *fname,
        }
 
        result = dns_db_find(db, name, NULL, dns_rdatatype_ns, options, now,
-                            NULL, fname, rdataset, sigrdataset);
+                            NULL, fname, rdataset, NULL);
        if (result != DNS_R_DELEGATION && result != ISC_R_SUCCESS) {
                /*
                 * The zone exists, but there is no delegation. Here again
@@ -1043,7 +1043,6 @@ findzonecut_zone(dns_view_t *view, const dns_name_t *name, dns_name_t *fname,
 cleanup:
        if (result != ISC_R_SUCCESS) {
                dns_rdataset_cleanup(rdataset);
-               dns_rdataset_cleanup(sigrdataset);
        }
 
        if (db != NULL) {
@@ -1060,13 +1059,13 @@ cleanup:
 static isc_result_t
 findzonecut_cache(dns_view_t *view, const dns_name_t *name, dns_name_t *fname,
                  dns_name_t *dcname, isc_stdtime_t now, unsigned int options,
-                 dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset) {
+                 dns_rdataset_t *rdataset) {
        isc_result_t result = DNS_R_NXDOMAIN;
 
        if (view->cachedb != NULL) {
                result = dns_db_findzonecut(view->cachedb, name, options, now,
                                            NULL, fname, dcname, rdataset,
-                                           sigrdataset);
+                                           NULL);
        }
 
        /*
@@ -1076,7 +1075,6 @@ findzonecut_cache(dns_view_t *view, const dns_name_t *name, dns_name_t *fname,
         */
        if (result != ISC_R_SUCCESS) {
                dns_rdataset_cleanup(rdataset);
-               dns_rdataset_cleanup(sigrdataset);
                result = DNS_R_NXDOMAIN;
        }
 
@@ -1087,16 +1085,15 @@ static void
 findzonecut_zoneorcache(dns_view_t *view, const dns_name_t *name,
                        dns_name_t *fname, dns_name_t *dcname,
                        isc_stdtime_t now, unsigned int options,
-                       dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset) {
+                       dns_rdataset_t *rdataset) {
        isc_result_t result;
        dns_rdataset_t crdataset = DNS_RDATASET_INIT;
-       dns_rdataset_t csigrdataset = DNS_RDATASET_INIT;
        dns_fixedname_t f, dc;
        dns_name_t *cfname = dns_fixedname_initname(&f);
        dns_name_t *cdcname = dns_fixedname_initname(&dc);
 
        CHECK(findzonecut_cache(view, name, cfname, cdcname, now, options,
-                               &crdataset, &csigrdataset));
+                               &crdataset));
 
        bool cacheclosest = dns_name_issubdomain(cfname, fname);
        bool staticstub = rdataset->attributes.staticstub &&
@@ -1104,12 +1101,7 @@ findzonecut_zoneorcache(dns_view_t *view, const dns_name_t *name,
 
        if (cacheclosest && !staticstub) {
                dns_rdataset_cleanup(rdataset);
-               dns_rdataset_cleanup(sigrdataset);
-
                dns_rdataset_clone(&crdataset, rdataset);
-               if (sigrdataset != NULL) {
-                       dns_rdataset_clone(&csigrdataset, sigrdataset);
-               }
 
                dns_name_copy(cfname, fname);
                if (dcname != NULL) {
@@ -1119,7 +1111,6 @@ findzonecut_zoneorcache(dns_view_t *view, const dns_name_t *name,
 
 cleanup:
        dns_rdataset_cleanup(&crdataset);
-       dns_rdataset_cleanup(&csigrdataset);
 }
 
 static isc_result_t
@@ -1146,14 +1137,14 @@ isc_result_t
 dns_view_findzonecut(dns_view_t *view, const dns_name_t *name,
                     dns_name_t *fname, dns_name_t *dcname, isc_stdtime_t now,
                     unsigned int options, bool usehints, bool usecache,
-                    dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset) {
+                    dns_rdataset_t *rdataset) {
        isc_result_t result;
 
        REQUIRE(DNS_VIEW_VALID(view));
        REQUIRE(view->frozen);
 
        result = findzonecut_zone(view, name, fname, dcname, now, options,
-                                 rdataset, sigrdataset);
+                                 rdataset);
 
        if (result == DNS_R_NXDOMAIN && usecache) {
                /*
@@ -1161,14 +1152,14 @@ dns_view_findzonecut(dns_view_t *view, const dns_name_t *name,
                 * delegation.
                 */
                result = findzonecut_cache(view, name, fname, dcname, now,
-                                          options, rdataset, sigrdataset);
+                                          options, rdataset);
        } else if (result == ISC_R_SUCCESS && usecache) {
                /*
                 * A zone with a (possibly partial) delegation match but the
                 * cache can have a more precise delegation.
                 */
                findzonecut_zoneorcache(view, name, fname, dcname, now, options,
-                                       rdataset, sigrdataset);
+                                       rdataset);
        }
 
        /*
@@ -1181,7 +1172,6 @@ dns_view_findzonecut(dns_view_t *view, const dns_name_t *name,
        if (result != ISC_R_SUCCESS) {
                result = DNS_R_NXDOMAIN;
                dns_rdataset_cleanup(rdataset);
-               dns_rdataset_cleanup(sigrdataset);
        }
 
        return result;