Commit 9771125c authored by Tom Lane's avatar Tom Lane

Fix recent changes to not break non-IPV6-aware systems.

parent 33ae03f4
...@@ -548,6 +548,8 @@ ipv4eq(struct sockaddr_in *a, struct sockaddr_in *b) ...@@ -548,6 +548,8 @@ ipv4eq(struct sockaddr_in *a, struct sockaddr_in *b)
return (a->sin_addr.s_addr == b->sin_addr.s_addr); return (a->sin_addr.s_addr == b->sin_addr.s_addr);
} }
#ifdef HAVE_IPV6
static bool static bool
ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b) ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
{ {
...@@ -560,6 +562,8 @@ ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b) ...@@ -560,6 +562,8 @@ ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
return true; return true;
} }
#endif /* HAVE_IPV6 */
/* /*
* Check to see if a connecting IP matches a given host name. * Check to see if a connecting IP matches a given host name.
*/ */
...@@ -614,6 +618,7 @@ check_hostname(hbaPort *port, const char *hostname) ...@@ -614,6 +618,7 @@ check_hostname(hbaPort *port, const char *hostname)
break; break;
} }
} }
#ifdef HAVE_IPV6
else if (gai->ai_addr->sa_family == AF_INET6) else if (gai->ai_addr->sa_family == AF_INET6)
{ {
if (ipv6eq((struct sockaddr_in6 *) gai->ai_addr, if (ipv6eq((struct sockaddr_in6 *) gai->ai_addr,
...@@ -623,6 +628,7 @@ check_hostname(hbaPort *port, const char *hostname) ...@@ -623,6 +628,7 @@ check_hostname(hbaPort *port, const char *hostname)
break; break;
} }
} }
#endif
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment