mirror of
https://github.com/postgres/postgres.git
synced 2025-07-08 11:42:09 +03:00
Fix recent changes to not break non-IPV6-aware systems.
This commit is contained in:
@ -548,6 +548,8 @@ ipv4eq(struct sockaddr_in *a, struct sockaddr_in *b)
|
||||
return (a->sin_addr.s_addr == b->sin_addr.s_addr);
|
||||
}
|
||||
|
||||
#ifdef HAVE_IPV6
|
||||
|
||||
static bool
|
||||
ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
|
||||
{
|
||||
@ -560,6 +562,8 @@ ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif /* HAVE_IPV6 */
|
||||
|
||||
/*
|
||||
* Check to see if a connecting IP matches a given host name.
|
||||
*/
|
||||
@ -614,6 +618,7 @@ check_hostname(hbaPort *port, const char *hostname)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_IPV6
|
||||
else if (gai->ai_addr->sa_family == AF_INET6)
|
||||
{
|
||||
if (ipv6eq((struct sockaddr_in6 *) gai->ai_addr,
|
||||
@ -623,6 +628,7 @@ check_hostname(hbaPort *port, const char *hostname)
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user