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");
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");
int ch;
int port;
const char *p;
- isc_boolean_t disable6 = ISC_FALSE;
- isc_boolean_t disable4 = ISC_FALSE;
save_command_line(argc, 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;
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)
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)