]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
when reloading the server, zone objects reused with a new
authorAndreas Gustafsson <source@isc.org>
Tue, 23 May 2000 04:38:22 +0000 (04:38 +0000)
committerAndreas Gustafsson <source@isc.org>
Tue, 23 May 2000 04:38:22 +0000 (04:38 +0000)
view object still referenced their old view

bin/named/server.c
lib/dns/zone.c

index 9a05e4c8ff549df6bd5a41ce9235d29a4c65abbf..6df21523fbfa166931987f01cd7298909d9fb4ac 100644 (file)
@@ -922,16 +922,21 @@ configure_zone(dns_c_ctx_t *cctx, dns_c_zone_t *czone, dns_c_view_t *cview,
                        dns_zone_detach(&zone);
        }
 
-       /*
-        * If we cannot reuse an existing zone, we will have to
-        * create a new one.
-        */
-       if (zone == NULL) {
+       if (zone != NULL) {
+               /*
+                * We found a reusable zone.  Make it use the
+                * new view.
+                */
+               dns_zone_setview(zone, view);
+       } else {
+               /*
+                * We cannot reuse an existing zone, we have
+                * to create a new one.
+                */
                CHECK(dns_zone_create(&zone, lctx->mctx));
                CHECK(dns_zone_setorigin(zone, origin));
                dns_zone_setview(zone, view);
-               CHECK(dns_zonemgr_managezone(ns_g_server->zonemgr,
-                                            zone));
+               CHECK(dns_zonemgr_managezone(ns_g_server->zonemgr, zone));
        }
 
        /*
index ac230027a3bb725ef32971747a32f86e99cb67f0..7cd47345b571ef13973261bc4376657b511c3748 100644 (file)
@@ -15,7 +15,7 @@
  * SOFTWARE.
  */
 
-/* $Id: zone.c,v 1.122 2000/05/22 17:23:11 gson Exp $ */
+/* $Id: zone.c,v 1.123 2000/05/23 04:38:22 gson Exp $ */
 
 #include <config.h>
 
@@ -487,6 +487,8 @@ dns_zone_setdbtype(dns_zone_t *zone, char *db_type) {
 
 void
 dns_zone_setview(dns_zone_t *zone, dns_view_t *view) {
+       if (zone->view != NULL)
+               dns_view_weakdetach(&zone->view);
        dns_view_weakattach(view, &zone->view);
 }