mirror of
https://github.com/postgres/postgres.git
synced 2025-11-19 13:42:17 +03:00
Remove configure probe for sockaddr_in6 and require AF_INET6.
SUSv3 <netinet/in.h> defines struct sockaddr_in6, and all targeted Unix systems have it. Windows has it in <ws2ipdef.h>. Remove the configure probe, the macro and a small amount of dead code. Also remove a mention of IPv6-less builds from the documentation, since there aren't any. This is similar to commitsf5580882and077bf2f2for Unix sockets. Even though AF_INET6 is an "optional" component of SUSv3, there are no known modern operating system without it, and it seems even less likely to be omitted from future systems than AF_UNIX. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://postgr.es/m/CA+hUKGKErNfhmvb_H0UprEmp4LPzGN06yR2_0tYikjzB-2ECMw@mail.gmail.com
This commit is contained in:
@@ -1725,9 +1725,7 @@ inet_client_addr(PG_FUNCTION_ARGS)
|
||||
switch (port->raddr.addr.ss_family)
|
||||
{
|
||||
case AF_INET:
|
||||
#ifdef HAVE_IPV6
|
||||
case AF_INET6:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
PG_RETURN_NULL();
|
||||
@@ -1764,9 +1762,7 @@ inet_client_port(PG_FUNCTION_ARGS)
|
||||
switch (port->raddr.addr.ss_family)
|
||||
{
|
||||
case AF_INET:
|
||||
#ifdef HAVE_IPV6
|
||||
case AF_INET6:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
PG_RETURN_NULL();
|
||||
@@ -1801,9 +1797,7 @@ inet_server_addr(PG_FUNCTION_ARGS)
|
||||
switch (port->laddr.addr.ss_family)
|
||||
{
|
||||
case AF_INET:
|
||||
#ifdef HAVE_IPV6
|
||||
case AF_INET6:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
PG_RETURN_NULL();
|
||||
@@ -1840,9 +1834,7 @@ inet_server_port(PG_FUNCTION_ARGS)
|
||||
switch (port->laddr.addr.ss_family)
|
||||
{
|
||||
case AF_INET:
|
||||
#ifdef HAVE_IPV6
|
||||
case AF_INET6:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
PG_RETURN_NULL();
|
||||
@@ -2102,7 +2094,6 @@ inetmi(PG_FUNCTION_ARGS)
|
||||
void
|
||||
clean_ipv6_addr(int addr_family, char *addr)
|
||||
{
|
||||
#ifdef HAVE_IPV6
|
||||
if (addr_family == AF_INET6)
|
||||
{
|
||||
char *pct = strchr(addr, '%');
|
||||
@@ -2110,5 +2101,4 @@ clean_ipv6_addr(int addr_family, char *addr)
|
||||
if (pct)
|
||||
*pct = '\0';
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -735,11 +735,8 @@ pg_stat_get_activity(PG_FUNCTION_ARGS)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (beentry->st_clientaddr.addr.ss_family == AF_INET
|
||||
#ifdef HAVE_IPV6
|
||||
|| beentry->st_clientaddr.addr.ss_family == AF_INET6
|
||||
#endif
|
||||
)
|
||||
if (beentry->st_clientaddr.addr.ss_family == AF_INET ||
|
||||
beentry->st_clientaddr.addr.ss_family == AF_INET6)
|
||||
{
|
||||
char remote_host[NI_MAXHOST];
|
||||
char remote_port[NI_MAXSERV];
|
||||
@@ -1105,9 +1102,7 @@ pg_stat_get_backend_client_addr(PG_FUNCTION_ARGS)
|
||||
switch (beentry->st_clientaddr.addr.ss_family)
|
||||
{
|
||||
case AF_INET:
|
||||
#ifdef HAVE_IPV6
|
||||
case AF_INET6:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
PG_RETURN_NULL();
|
||||
@@ -1152,9 +1147,7 @@ pg_stat_get_backend_client_port(PG_FUNCTION_ARGS)
|
||||
switch (beentry->st_clientaddr.addr.ss_family)
|
||||
{
|
||||
case AF_INET:
|
||||
#ifdef HAVE_IPV6
|
||||
case AF_INET6:
|
||||
#endif
|
||||
break;
|
||||
case AF_UNIX:
|
||||
PG_RETURN_INT32(-1);
|
||||
|
||||
Reference in New Issue
Block a user