From: Ondřej Surý Date: Thu, 19 Feb 2026 11:55:45 +0000 (+0100) Subject: Rename isc_net_getudpportrange() to isc_net_getportrange() X-Git-Tag: v9.21.19~16^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=295139f8ca7054934ee455106385dff1905fcd01;p=thirdparty%2Fbind9.git 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. --- diff --git a/bin/named/server.c b/bin/named/server.c index a881560a289..85e8c686526 100644 --- a/bin/named/server.c +++ b/bin/named/server.c @@ -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)) { diff --git a/bin/nsupdate/nsupdate.c b/bin/nsupdate/nsupdate.c index 0f83d40be57..a51441e2a14 100644 --- a/bin/nsupdate/nsupdate.c +++ b/bin/nsupdate/nsupdate.c @@ -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); diff --git a/bin/tools/mdig.c b/bin/tools/mdig.c index d0a2c7145ca..e43c87e7cee 100644 --- a/bin/tools/mdig.c +++ b/bin/tools/mdig.c @@ -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); diff --git a/lib/dns/client.c b/lib/dns/client.c index 73ea515cecc..91e74e17b23 100644 --- a/lib/dns/client.c +++ b/lib/dns/client.c @@ -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); diff --git a/lib/dns/dispatch.c b/lib/dns/dispatch.c index 67a27894d5f..9b5c224ef91 100644 --- a/lib/dns/dispatch.c +++ b/lib/dns/dispatch.c @@ -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); diff --git a/lib/isc/include/isc/net.h b/lib/isc/include/isc/net.h index f4062db18e6..9a544ea4ff3 100644 --- a/lib/isc/include/isc/net.h +++ b/lib/isc/include/isc/net.h @@ -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 diff --git a/lib/isc/managers.c b/lib/isc/managers.c index 6107620c138..5c73a7ef4c0 100644 --- a/lib/isc/managers.c +++ b/lib/isc/managers.c @@ -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); } diff --git a/lib/isc/net.c b/lib/isc/net.c index 5ac2866fe54..c82038c5a38 100644 --- a/lib/isc/net.c +++ b/lib/isc/net.c @@ -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); diff --git a/lib/isc/netmgr/netmgr.c b/lib/isc/netmgr/netmgr.c index 8dc4fcd4f27..a106df9613d 100644 --- a/lib/isc/netmgr/netmgr.c +++ b/lib/isc/netmgr/netmgr.c @@ -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); }