]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
2623. [bug] Named started seaches for DS non-optimally. [RT #19915]
authorMark Andrews <marka@isc.org>
Mon, 13 Jul 2009 06:33:11 +0000 (06:33 +0000)
committerMark Andrews <marka@isc.org>
Mon, 13 Jul 2009 06:33:11 +0000 (06:33 +0000)
CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index 5a3ca89cda66cd7c4cbc2c5c7da12adab7068f16..c4b962bb56122108ac985569969df878fd4c2fef 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+2623.  [bug]           Named started seaches for DS non-optimally. [RT #19915]
+
 2621.  [doc]           Made copyright boilterplate consistent.  [RT #19833]
 
 2920.  [bug]           Delay thawing the zone until the reload of it has
index 05173805f166979af03b1f9b7a24213ee77d0c7d..cdb1475544d485cd60daf6296f89349519c5c06c 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.355.12.42 2009/06/02 23:46:44 tbox Exp $ */
+/* $Id: resolver.c,v 1.355.12.43 2009/07/13 06:33:11 marka Exp $ */
 
 /*! \file */
 
@@ -2514,7 +2514,7 @@ fctx_getaddresses(fetchctx_t *fctx) {
                 * DS records are found in the parent server.
                 * Strip label to get the correct forwarder (if any).
                 */
-               if (fctx->type == dns_rdatatype_ds &&
+               if (dns_rdatatype_atparent(fctx->type) &&
                    dns_name_countlabels(name) > 1) {
                        dns_name_init(&suffix, NULL);
                        labels = dns_name_countlabels(name);
@@ -3404,21 +3404,22 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
        if (domain == NULL) {
                dns_forwarders_t *forwarders = NULL;
                unsigned int labels;
+               dns_name_t *fwdname = name;
 
                /*
                 * DS records are found in the parent server.
                 * Strip label to get the correct forwarder (if any).
                 */
-               if (fctx->type == dns_rdatatype_ds &&
+               if (dns_rdatatype_atparent(fctx->type) &&
                    dns_name_countlabels(name) > 1) {
                        dns_name_init(&suffix, NULL);
                        labels = dns_name_countlabels(name);
                        dns_name_getlabelsequence(name, 1, labels - 1, &suffix);
-                       name = &suffix;
+                       fwdname = &suffix;
                }
                dns_fixedname_init(&fixed);
                domain = dns_fixedname_name(&fixed);
-               result = dns_fwdtable_find2(fctx->res->view->fwdtable, name,
+               result = dns_fwdtable_find2(fctx->res->view->fwdtable, fwdname,
                                            domain, &forwarders);
                if (result == ISC_R_SUCCESS)
                        fctx->fwdpolicy = forwarders->fwdpolicy;
@@ -3429,7 +3430,7 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
                         * nameservers, and we're not in forward-only mode,
                         * so find the best nameservers to use.
                         */
-                       if (dns_rdatatype_atparent(type))
+                       if (dns_rdatatype_atparent(fctx->type))
                                findoptions |= DNS_DBFIND_NOEXACT;
                        result = dns_view_findzonecut(res->view, name, domain,
                                                      0, findoptions, ISC_TRUE,