From bcc8b14ef630b2ad9aae7813981fb248fbff9ed8 Mon Sep 17 00:00:00 2001 From: Thomas Munro Date: Fri, 26 Aug 2022 10:13:22 +1200 Subject: Remove configure probe for sockaddr_in6 and require AF_INET6. SUSv3 defines struct sockaddr_in6, and all targeted Unix systems have it. Windows has it in . 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 commits f5580882 and 077bf2f2 for 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 Discussion: https://postgr.es/m/CA+hUKGKErNfhmvb_H0UprEmp4LPzGN06yR2_0tYikjzB-2ECMw@mail.gmail.com --- src/backend/utils/adt/pgstatfuncs.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/backend/utils/adt/pgstatfuncs.c') diff --git a/src/backend/utils/adt/pgstatfuncs.c b/src/backend/utils/adt/pgstatfuncs.c index d9e2a793829..4cca30aae7c 100644 --- a/src/backend/utils/adt/pgstatfuncs.c +++ b/src/backend/utils/adt/pgstatfuncs.c @@ -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); -- cgit v1.2.3