2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

1012. [bug] The -p option to named did not behave as documented.

This commit is contained in:
Andreas Gustafsson
2001-09-20 21:51:22 +00:00
parent 3bf31a5161
commit d9e690eb71
3 changed files with 15 additions and 11 deletions

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.344 2001/09/20 15:16:24 marka Exp $ */
/* $Id: server.c,v 1.345 2001/09/20 21:51:22 gson Exp $ */
#include <config.h>
@@ -1734,7 +1734,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"
@@ -2708,9 +2711,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,