summaryrefslogtreecommitdiff
path: root/src/port
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2022-08-26 10:13:22 +1200
committerThomas Munro <tmunro@postgresql.org>2022-08-26 10:18:30 +1200
commitbcc8b14ef630b2ad9aae7813981fb248fbff9ed8 (patch)
tree522dcfb926b2b235137aec71256dbb281c1dd5af /src/port
parent28ec316787674dd74d00b296724a009b6edc2fb0 (diff)
downloadpostgresql-bcc8b14ef630b2ad9aae7813981fb248fbff9ed8.tar.gz
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 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 <andres@anarazel.de> Discussion: https://postgr.es/m/CA+hUKGKErNfhmvb_H0UprEmp4LPzGN06yR2_0tYikjzB-2ECMw@mail.gmail.com
Diffstat (limited to 'src/port')
-rw-r--r--src/port/inet_net_ntop.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/port/inet_net_ntop.c b/src/port/inet_net_ntop.c
index b8ad69c390..500c66dbf1 100644
--- a/src/port/inet_net_ntop.c
+++ b/src/port/inet_net_ntop.c
@@ -80,15 +80,14 @@ pg_inet_net_ntop(int af, const void *src, int bits, char *dst, size_t size)
* We need to cover both the address family constants used by the PG inet
* type (PGSQL_AF_INET and PGSQL_AF_INET6) and those used by the system
* libraries (AF_INET and AF_INET6). We can safely assume PGSQL_AF_INET
- * == AF_INET, but the INET6 constants are very likely to be different. If
- * AF_INET6 isn't defined, silently ignore it.
+ * == AF_INET, but the INET6 constants are very likely to be different.
*/
switch (af)
{
case PGSQL_AF_INET:
return (inet_net_ntop_ipv4(src, bits, dst, size));
case PGSQL_AF_INET6:
-#if defined(AF_INET6) && AF_INET6 != PGSQL_AF_INET6
+#if AF_INET6 != PGSQL_AF_INET6
case AF_INET6:
#endif
return (inet_net_ntop_ipv6(src, bits, dst, size));