]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1012. [bug] The -p option to named did not behave as documented.
authorMark Andrews <marka@isc.org>
Thu, 24 Jan 2002 03:06:25 +0000 (03:06 +0000)
committerMark Andrews <marka@isc.org>
Thu, 24 Jan 2002 03:06:25 +0000 (03:06 +0000)
CHANGES
bin/named/config.c
bin/named/server.c

diff --git a/CHANGES b/CHANGES
index 7e401820c5cf0e8fb141a601d8c7bff08d713c44..0aae8fceadc52c246760b873c54cd6d111998990 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -98,6 +98,7 @@
 
 1123.  [bug]           dig +[no]fail did not match description. [RT #2052]
 
+1012.  [bug]           The -p option to named did not behave as documented.
 
        --- 9.2.0 released ---
 
index cbe2a58e8c49291b3a27189226f91bbb1d3336aa..5387e599f987cfcc7f8ed0435f1a4cab4423555b 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: config.c,v 1.11.2.1 2001/09/21 20:30:32 gson Exp $ */
+/* $Id: config.c,v 1.11.2.2 2002/01/24 03:06:23 marka Exp $ */
 
 #include <config.h>
 
@@ -419,11 +419,6 @@ ns_config_getport(cfg_obj_t *config, in_port_t *portp) {
        isc_result_t result;
        int i;
 
-       if (ns_g_port != 0) {
-               *portp = ns_g_port;
-               return (ISC_R_SUCCESS);
-       }
-
        cfg_map_get(config, "options", &options);
        i = 0;
        if (options != NULL)
index 414c153167cc33ba84e07a380140888cbeb690e9..d8b5def13ea775562bee9c4c19ba50a1f4ae1546 100644 (file)
@@ -15,7 +15,7 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: server.c,v 1.339.2.2 2002/01/23 02:11:32 gson Exp $ */
+/* $Id: server.c,v 1.339.2.3 2002/01/24 03:06:25 marka Exp $ */
 
 #include <config.h>
 
@@ -1088,7 +1088,10 @@ configure_forward(cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
        /*
         * Determine which port to send forwarded requests to.
         */
-       CHECKM(ns_config_getport(config, &port), "port");
+       if (ns_g_lwresdonly && ns_g_port != 0)
+               port = ns_g_port;
+       else
+               CHECKM(ns_config_getport(config, &port), "port");
 
        if (forwarders != NULL) {
                portobj = cfg_tuple_get(forwarders, "port");
@@ -1727,7 +1730,10 @@ load_configuration(const char *filename, ns_server_t *server,
        /*
         * Determine which port to use for listening for incoming connections.
         */
-       CHECKM(ns_config_getport(config, &listen_port), "port");
+       if (ns_g_port != 0)
+               listen_port = ns_g_port;
+       else
+               CHECKM(ns_config_getport(config, &listen_port), "port");
 
        /*
         * Configure the interface manager according to the "listen-on"
@@ -2671,9 +2677,13 @@ ns_listenelt_fromconfig(cfg_obj_t *listener, cfg_obj_t *config,
 
        portobj = cfg_tuple_get(listener, "port");
        if (!cfg_obj_isuint32(portobj)) {
-               result = ns_config_getport(config, &port);
-               if (result != ISC_R_SUCCESS)
-                       return (result);
+               if (ns_g_port != 0) {
+                       port = ns_g_port;
+               } else {
+                       result = ns_config_getport(config, &port);
+                       if (result != ISC_R_SUCCESS)
+                               return (result);
+               }
        } else {
                if (cfg_obj_asuint32(portobj) >= ISC_UINT16_MAX) {
                        cfg_obj_log(portobj, ns_g_lctx, ISC_LOG_ERROR,