mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-25 02:47:54 -04:00
Rename isc_net_getudpportrange() to isc_net_getportrange()
This better reflects the true nature of the function as we are reading the ephemeral port range which is not related to UDP at all.
This commit is contained in:
parent
04c81b55d2
commit
295139f8ca
9 changed files with 21 additions and 21 deletions
|
|
@ -8048,7 +8048,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *bindkeys,
|
|||
isc_portset_create(isc_g_mctx, &v4portset);
|
||||
isc_portset_create(isc_g_mctx, &v6portset);
|
||||
|
||||
isc_net_getudpportrange(AF_INET, &port_low, &port_high);
|
||||
isc_net_getportrange(AF_INET, &port_low, &port_high);
|
||||
isc_netmgr_portrange(AF_INET, port_low, port_high);
|
||||
isc_portset_addrange(v4portset, port_low, port_high);
|
||||
if (!ns_server_getoption(server->sctx, NS_SERVER_DISABLE4)) {
|
||||
|
|
@ -8059,7 +8059,7 @@ apply_configuration(cfg_obj_t *effectiveconfig, cfg_obj_t *bindkeys,
|
|||
port_low, port_high);
|
||||
}
|
||||
|
||||
isc_net_getudpportrange(AF_INET6, &port_low, &port_high);
|
||||
isc_net_getportrange(AF_INET6, &port_low, &port_high);
|
||||
isc_netmgr_portrange(AF_INET6, port_low, port_high);
|
||||
isc_portset_addrange(v6portset, port_low, port_high);
|
||||
if (!ns_server_getoption(server->sctx, NS_SERVER_DISABLE6)) {
|
||||
|
|
|
|||
|
|
@ -749,11 +749,11 @@ set_source_ports(dns_dispatchmgr_t *manager) {
|
|||
isc_result_t result;
|
||||
|
||||
isc_portset_create(isc_g_mctx, &v4portset);
|
||||
isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
|
||||
isc_net_getportrange(AF_INET, &udpport_low, &udpport_high);
|
||||
isc_portset_addrange(v4portset, udpport_low, udpport_high);
|
||||
|
||||
isc_portset_create(isc_g_mctx, &v6portset);
|
||||
isc_net_getudpportrange(AF_INET6, &udpport_low, &udpport_high);
|
||||
isc_net_getportrange(AF_INET6, &udpport_low, &udpport_high);
|
||||
isc_portset_addrange(v6portset, udpport_low, udpport_high);
|
||||
|
||||
result = dns_dispatchmgr_setavailports(manager, v4portset, v6portset);
|
||||
|
|
|
|||
|
|
@ -2001,12 +2001,12 @@ set_source_ports(dns_dispatchmgr_t *manager) {
|
|||
isc_result_t result;
|
||||
|
||||
isc_portset_create(isc_g_mctx, &v4portset);
|
||||
isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
|
||||
isc_net_getportrange(AF_INET, &udpport_low, &udpport_high);
|
||||
|
||||
isc_portset_addrange(v4portset, udpport_low, udpport_high);
|
||||
|
||||
isc_portset_create(isc_g_mctx, &v6portset);
|
||||
isc_net_getudpportrange(AF_INET6, &udpport_low, &udpport_high);
|
||||
isc_net_getportrange(AF_INET6, &udpport_low, &udpport_high);
|
||||
|
||||
isc_portset_addrange(v6portset, udpport_low, udpport_high);
|
||||
|
||||
|
|
|
|||
|
|
@ -142,11 +142,11 @@ setsourceports(isc_mem_t *mctx, dns_dispatchmgr_t *manager) {
|
|||
isc_result_t result;
|
||||
|
||||
isc_portset_create(mctx, &v4portset);
|
||||
isc_net_getudpportrange(AF_INET, &udpport_low, &udpport_high);
|
||||
isc_net_getportrange(AF_INET, &udpport_low, &udpport_high);
|
||||
isc_portset_addrange(v4portset, udpport_low, udpport_high);
|
||||
|
||||
isc_portset_create(mctx, &v6portset);
|
||||
isc_net_getudpportrange(AF_INET6, &udpport_low, &udpport_high);
|
||||
isc_net_getportrange(AF_INET6, &udpport_low, &udpport_high);
|
||||
isc_portset_addrange(v6portset, udpport_low, udpport_high);
|
||||
|
||||
result = dns_dispatchmgr_setavailports(manager, v4portset, v6portset);
|
||||
|
|
|
|||
|
|
@ -914,7 +914,7 @@ static void
|
|||
create_default_portset(isc_mem_t *mctx, int family, isc_portset_t **portsetp) {
|
||||
in_port_t low, high;
|
||||
|
||||
isc_net_getudpportrange(family, &low, &high);
|
||||
isc_net_getportrange(family, &low, &high);
|
||||
|
||||
isc_portset_create(mctx, portsetp);
|
||||
isc_portset_addrange(*portsetp, low, high);
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ void
|
|||
isc_net_enableipv6(void);
|
||||
|
||||
void
|
||||
isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high);
|
||||
isc_net_getportrange(int af, in_port_t *low, in_port_t *high);
|
||||
/*%<
|
||||
* Returns system's default range of ephemeral UDP ports, if defined.
|
||||
* If the range is not available or unknown, ISC_NET_PORTRANGELOW and
|
||||
|
|
|
|||
|
|
@ -25,10 +25,10 @@ isc_managers_create(uint32_t workers) {
|
|||
isc_netmgr_create(isc_g_mctx);
|
||||
isc_rwlock_setworkers(workers);
|
||||
|
||||
isc_net_getudpportrange(AF_INET, &port_low, &port_high);
|
||||
isc_net_getportrange(AF_INET, &port_low, &port_high);
|
||||
isc_netmgr_portrange(AF_INET, port_low, port_high);
|
||||
|
||||
isc_net_getudpportrange(AF_INET6, &port_low, &port_high);
|
||||
isc_net_getportrange(AF_INET6, &port_low, &port_high);
|
||||
isc_netmgr_portrange(AF_INET6, port_low, port_high);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ isc_net_probeipv6(void) {
|
|||
#if defined(USE_SYSCTL_PORTRANGE)
|
||||
#if defined(HAVE_SYSCTLBYNAME)
|
||||
static isc_result_t
|
||||
getudpportrange_sysctl(int af, in_port_t *low, in_port_t *high) {
|
||||
getportrange_sysctl(int af, in_port_t *low, in_port_t *high) {
|
||||
int port_low, port_high;
|
||||
size_t portlen;
|
||||
const char *sysctlname_lowport, *sysctlname_hiport;
|
||||
|
|
@ -134,7 +134,7 @@ getudpportrange_sysctl(int af, in_port_t *low, in_port_t *high) {
|
|||
}
|
||||
#else /* !HAVE_SYSCTLBYNAME */
|
||||
static isc_result_t
|
||||
getudpportrange_sysctl(int af, in_port_t *low, in_port_t *high) {
|
||||
getportrange_sysctl(int af, in_port_t *low, in_port_t *high) {
|
||||
int mib_lo4[4] = SYSCTL_V4PORTRANGE_LOW;
|
||||
int mib_hi4[4] = SYSCTL_V4PORTRANGE_HIGH;
|
||||
int mib_lo6[4] = SYSCTL_V6PORTRANGE_LOW;
|
||||
|
|
@ -176,17 +176,17 @@ getudpportrange_sysctl(int af, in_port_t *low, in_port_t *high) {
|
|||
#endif /* USE_SYSCTL_PORTRANGE */
|
||||
|
||||
void
|
||||
isc_net_getudpportrange(int af, in_port_t *low, in_port_t *high) {
|
||||
isc_net_getportrange(int af, in_port_t *low, in_port_t *high) {
|
||||
int result = ISC_R_FAILURE;
|
||||
#if !defined(USE_SYSCTL_PORTRANGE) && defined(__linux)
|
||||
#if !defined(USE_SYSCTL_PORTRANGE) && defined(__linux__)
|
||||
FILE *fp;
|
||||
#endif /* if !defined(USE_SYSCTL_PORTRANGE) && defined(__linux) */
|
||||
#endif /* if !defined(USE_SYSCTL_PORTRANGE) && defined(__linux__) */
|
||||
|
||||
REQUIRE(low != NULL && high != NULL);
|
||||
|
||||
#if defined(USE_SYSCTL_PORTRANGE)
|
||||
result = getudpportrange_sysctl(af, low, high);
|
||||
#elif defined(__linux)
|
||||
result = getportrange_sysctl(af, low, high);
|
||||
#elif defined(__linux__)
|
||||
|
||||
UNUSED(af);
|
||||
|
||||
|
|
|
|||
|
|
@ -247,10 +247,10 @@ isc_netmgr_create(isc_mem_t *mctx) {
|
|||
/*
|
||||
* Set the initial port range for IP_LOCAL_PORT_RANGE.
|
||||
*/
|
||||
isc_net_getudpportrange(AF_INET, &port_low, &port_high);
|
||||
isc_net_getportrange(AF_INET, &port_low, &port_high);
|
||||
isc_netmgr_portrange(AF_INET, port_low, port_high);
|
||||
|
||||
isc_net_getudpportrange(AF_INET6, &port_low, &port_high);
|
||||
isc_net_getportrange(AF_INET6, &port_low, &port_high);
|
||||
isc_netmgr_portrange(AF_INET6, port_low, port_high);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue