]> 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:34:13 +0000 (06:34 +0000)
committerMark Andrews <marka@isc.org>
Mon, 13 Jul 2009 06:34:13 +0000 (06:34 +0000)
CHANGES
lib/dns/resolver.c

diff --git a/CHANGES b/CHANGES
index bfba5539cb00f68fb65d2e2e938fc84c0f826f01..4ec0a495f9556c856436c47184832d65ccb53422 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 ac2f89fe0bd13bcd0d5b4083889c7ad95ecedecd..0435c3b633cbbc5c2ff6c7ff64f5a42b5fdd0d07 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: resolver.c,v 1.284.18.91 2009/06/02 23:46:04 tbox Exp $ */
+/* $Id: resolver.c,v 1.284.18.92 2009/07/13 06:34:13 marka Exp $ */
 
 /*! \file */
 
@@ -2347,7 +2347,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);
@@ -3218,21 +3218,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;
@@ -3243,7 +3244,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,