]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
In ns_controls_configure(), moved the ns_controls_shutdown() call that
authorDavid Lawrence <source@isc.org>
Thu, 31 May 2001 21:49:11 +0000 (21:49 +0000)
committerDavid Lawrence <source@isc.org>
Thu, 31 May 2001 21:49:11 +0000 (21:49 +0000)
removes no longer configured listeners into the block that actually
updates/add listeners, because when ns_controls_configure() recursively
calls itself to configure a 127.1 channel if there is no controls() statement,
the top level ns_controls_configure() was shutting down the channel that
the enclosing ns_controls_configure() just created.

bin/named/controlconf.c

index 44827d67e3510cf56f7cd2a860a1b68a1479a2de..4d6e617902fe0516c13f58af44d51a9e84cb6905 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: controlconf.c,v 1.10 2001/05/31 18:34:47 tale Exp $ */
+/* $Id: controlconf.c,v 1.11 2001/05/31 21:49:11 tale Exp $ */
 
 #include <config.h>
 
@@ -1264,8 +1264,8 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
                                         * Remove the listener from the old
                                         * list, so it won't be shut down.
                                         */
-                                       ISC_LIST_UNLINK(cp->listeners, listener,
-                                                       link);
+                                       ISC_LIST_UNLINK(cp->listeners,
+                                                       listener, link);
                                else
                                        /*
                                         * This is a new listener.
@@ -1281,6 +1281,22 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
                }
 
                finalize_automagic_key();
+
+               /*
+                * ns_control_shutdown() will stop whatever is on the global
+                * listeners list, which currently only has whatever sockaddrs
+                * were in the previous configuration (if any) that do not
+                * remain in the current configuration.
+                */
+               ns_controls_shutdown(cp);
+
+               /*
+                * Put all of the valid listeners on the listeners list.
+                * Anything already on listeners in the process of shutting
+                * down will be taken care of by listen_done().
+                */
+               ISC_LIST_APPENDLIST(cp->listeners, new_listeners, link);
+
        } else {
                isc_result_t result;
 
@@ -1291,22 +1307,6 @@ ns_controls_configure(ns_controls_t *cp, cfg_obj_t *config,
                                             aclconfctx);
        }
 
-
-       /*
-        * ns_control_shutdown() will stop whatever is on the global listeners
-        * list, which currently only has whatever sockaddrs were in the
-        * previous configuration (if any) that do not remain in the current
-        * configuration.
-        */
-       ns_controls_shutdown(cp);
-
-       /*
-        * Put all of the valid listeners on the listeners list.
-        * Anything already on listeners in the process of shutting down
-        * will be taken care of by listen_done().
-        */
-       ISC_LIST_APPENDLIST(cp->listeners, new_listeners, link);
-
        return (ISC_R_SUCCESS);
 }