diff --git a/CHANGES b/CHANGES index 91ab941714..7de75422ed 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3968. [bug] Silence spurious log messages when using 'named -[46]'. + [RT #37308] + 3967. [test] Add test for inlined signed zone in multiple views with different DNSKEY sets. [RT #35759] diff --git a/bin/named/include/named/globals.h b/bin/named/include/named/globals.h index 3c261d3b59..e47bda8895 100644 --- a/bin/named/include/named/globals.h +++ b/bin/named/include/named/globals.h @@ -167,6 +167,9 @@ EXTERN isc_boolean_t ns_g_nosoa INIT(ISC_FALSE); EXTERN isc_boolean_t ns_g_noaa INIT(ISC_FALSE); EXTERN unsigned int ns_g_delay INIT(0); EXTERN isc_boolean_t ns_g_nonearest INIT(ISC_FALSE); +EXTERN isc_boolean_t ns_g_disable6 INIT(ISC_FALSE); +EXTERN isc_boolean_t ns_g_disable4 INIT(ISC_FALSE); + #ifdef HAVE_GEOIP EXTERN dns_geoip_databases_t *ns_g_geoip INIT(NULL); diff --git a/bin/named/interfacemgr.c b/bin/named/interfacemgr.c index c263c997aa..137845e0b5 100644 --- a/bin/named/interfacemgr.c +++ b/bin/named/interfacemgr.c @@ -814,7 +814,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, if (isc_net_probeipv6() == ISC_R_SUCCESS) scan_ipv6 = ISC_TRUE; #ifdef WANT_IPV6 - else + else if (!ns_g_disable6) isc_log_write(IFMGR_COMMON_LOGARGS, verbose ? ISC_LOG_INFO : ISC_LOG_DEBUG(1), "no IPv6 interfaces found"); @@ -822,7 +822,7 @@ do_scan(ns_interfacemgr_t *mgr, ns_listenlist_t *ext_listen, if (isc_net_probeipv4() == ISC_R_SUCCESS) scan_ipv4 = ISC_TRUE; - else + else if (!ns_g_disable4) isc_log_write(IFMGR_COMMON_LOGARGS, verbose ? ISC_LOG_INFO : ISC_LOG_DEBUG(1), "no IPv4 interfaces found"); diff --git a/bin/named/main.c b/bin/named/main.c index 2e2f67b7d3..409edc35d3 100644 --- a/bin/named/main.c +++ b/bin/named/main.c @@ -416,8 +416,6 @@ parse_command_line(int argc, char *argv[]) { int ch; int port; const char *p; - isc_boolean_t disable6 = ISC_FALSE; - isc_boolean_t disable4 = ISC_FALSE; save_command_line(argc, argv); @@ -427,20 +425,20 @@ parse_command_line(int argc, char *argv[]) { while ((ch = isc_commandline_parse(argc, argv, CMDLINE_FLAGS)) != -1) { switch (ch) { case '4': - if (disable4) + if (ns_g_disable4) ns_main_earlyfatal("cannot specify -4 and -6"); if (isc_net_probeipv4() != ISC_R_SUCCESS) ns_main_earlyfatal("IPv4 not supported by OS"); isc_net_disableipv6(); - disable6 = ISC_TRUE; + ns_g_disable6 = ISC_TRUE; break; case '6': - if (disable6) + if (ns_g_disable6) ns_main_earlyfatal("cannot specify -4 and -6"); if (isc_net_probeipv6() != ISC_R_SUCCESS) ns_main_earlyfatal("IPv6 not supported by OS"); isc_net_disableipv4(); - disable4 = ISC_TRUE; + ns_g_disable4 = ISC_TRUE; break; case 'c': ns_g_conffile = isc_commandline_argument; diff --git a/bin/named/server.c b/bin/named/server.c index 68a39b973a..aed628fc82 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -5645,10 +5645,11 @@ load_configuration(const char *filename, ns_server_t *server, isc_portset_addrange(v4portset, udpport_low, udpport_high); } - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, - NS_LOGMODULE_SERVER, ISC_LOG_INFO, - "using default UDP/IPv4 port range: [%d, %d]", - udpport_low, udpport_high); + if (!ns_g_disable4) + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_INFO, + "using default UDP/IPv4 port range: " + "[%d, %d]", udpport_low, udpport_high); } (void)ns_config_get(maps, "avoid-v4-udp-ports", &avoidv4ports); if (avoidv4ports != NULL) @@ -5667,10 +5668,11 @@ load_configuration(const char *filename, ns_server_t *server, isc_portset_addrange(v6portset, udpport_low, udpport_high); } - isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, - NS_LOGMODULE_SERVER, ISC_LOG_INFO, - "using default UDP/IPv6 port range: [%d, %d]", - udpport_low, udpport_high); + if (!ns_g_disable6) + isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, + NS_LOGMODULE_SERVER, ISC_LOG_INFO, + "using default UDP/IPv6 port range: " + "[%d, %d]", udpport_low, udpport_high); } (void)ns_config_get(maps, "avoid-v6-udp-ports", &avoidv6ports); if (avoidv6ports != NULL)