]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
don't INSIST() that calling dns_db_find() on the root hints
authorAndreas Gustafsson <source@isc.org>
Mon, 27 Aug 2001 17:20:10 +0000 (17:20 +0000)
committerAndreas Gustafsson <source@isc.org>
Mon, 27 Aug 2001 17:20:10 +0000 (17:20 +0000)
only binds the rdataset when returning ISC_R_SUCCESS, because that's not the case -
for example, if the root hints are '. 300 IN CNAME .', DNS_R_CNAME is returned and
the rdataset is bound

bin/named/query.c
lib/dns/view.c

index 70a472d0eb977d05ebe95542d1b5dccdf0a49af9..7f75489c8f2e1494f80913df35703f5873eeac51 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: query.c,v 1.197 2001/08/27 06:10:15 marka Exp $ */
+/* $Id: query.c,v 1.198 2001/08/27 17:20:09 gson Exp $ */
 
 #include <config.h>
 
@@ -2608,10 +2608,17 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
                                             rdataset, sigrdataset);
                }
                if (result != ISC_R_SUCCESS) {
-                       INSIST(node == NULL);
-                       INSIST(!dns_rdataset_isassociated(rdataset));
-                       INSIST(sigrdataset == NULL ||
-                             !dns_rdataset_isassociated(sigrdataset));
+                       /*
+                        * Nonsensical root hints may require cleanup.
+                        */
+                       if (dns_rdataset_isassociated(rdataset))
+                               dns_rdataset_disassociate(rdataset);
+                       if (sigrdataset != NULL &&
+                           dns_rdataset_isassociated(sigrdataset))
+                               dns_rdataset_disassociate(sigrdataset);
+                       if (node != NULL)
+                               dns_db_detachnode(db, &node);
+
                        /*
                         * We don't have any root server hints, but
                         * we may have working forwarders, so try to
index 405701630a2fc685855e440a745f926e8cec7c96..e6c4d0c9c09e3c3e1f43559f206f9fbf27e972ca 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: view.c,v 1.102 2001/08/27 06:10:17 marka Exp $ */
+/* $Id: view.c,v 1.103 2001/08/27 17:20:10 gson Exp $ */
 
 #include <config.h>
 
@@ -998,8 +998,9 @@ dns_view_findzonecut(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
                         * We can't even find the hints for the root
                         * nameservers!
                         */
+                       if (dns_rdataset_isassociated(rdataset))
+                               dns_rdataset_disassociate(rdataset);
                        result = ISC_R_NOTFOUND;
-                       INSIST(!dns_rdataset_isassociated(rdataset));
                }
        }