]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
pullup:
authorAndreas Gustafsson <source@isc.org>
Fri, 28 Jul 2000 22:24:47 +0000 (22:24 +0000)
committerAndreas Gustafsson <source@isc.org>
Fri, 28 Jul 2000 22:24:47 +0000 (22:24 +0000)
Allow zones with no NS records to be loaded and/or transferred in.  Log
an error if the zone is loaded, but continue anyway.
(RT #205)

lib/dns/zone.c

index fb74a93313f0a5df1118b1e4881d668ec7bdd082..3151ae5cce77696bc998f5d77f7ce1d207f558d0 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: zone.c,v 1.152.2.3 2000/07/28 05:37:31 gson Exp $ */
+/* $Id: zone.c,v 1.152.2.4 2000/07/28 22:24:47 gson Exp $ */
 
 #include <config.h>
 
@@ -735,17 +735,15 @@ dns_zone_load(dns_zone_t *zone) {
        case dns_zone_master:
        case dns_zone_slave:
        case dns_zone_stub:
-               if (soacount != 1 || nscount == 0) {
-                       if (soacount != 1)
-                               zone_log(zone, me, ISC_LOG_ERROR,
-                                        "has %d SOA record%s", soacount,
-                                        (soacount != 0) ? "s" : "");
-                       if (nscount == 0)
-                               zone_log(zone, me, ISC_LOG_ERROR,
-                                        "no NS records");
+               if (soacount != 1) {
+                       zone_log(zone, me, ISC_LOG_ERROR,
+                                "has %d SOA record%s", soacount,
+                                (soacount != 0) ? "s" : "");
                        result = DNS_R_BADZONE;
                        goto cleanup;
                }
+               if (nscount == 0)
+                       zone_log(zone, me, ISC_LOG_ERROR, "no NS records");
                if (zone->db != NULL) {
                        if (!isc_serial_ge(serial, zone->serial)) {
                                zone_log(zone, me, ISC_LOG_ERROR,
@@ -836,7 +834,12 @@ zone_count_ns_rr(dns_db_t *db, dns_dbnode_t *node, dns_dbversion_t *version,
        dns_rdataset_init(&rdataset);
        result = dns_db_findrdataset(db, node, version, dns_rdatatype_ns,
                                     dns_rdatatype_none, 0, &rdataset, NULL);
-       if (result != ISC_R_SUCCESS)
+       if (result == ISC_R_NOTFOUND) {
+               *nscount = 0;
+               result = ISC_R_SUCCESS;
+               goto invalidate_rdataset;
+       }
+       else if (result != ISC_R_SUCCESS)
                goto invalidate_rdataset;
 
        count = 0;