SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
|
@ -0,0 +1,29 @@
|
|||
Use the address family from the address, not from the netmask,
|
||||
since the latter is unreliable. Fixes "samenet"/"samehost".
|
||||
|
||||
Index: src/backend/libpq/ifaddr.c
|
||||
--- src/backend/libpq/ifaddr.c.orig
|
||||
+++ src/backend/libpq/ifaddr.c
|
||||
@@ -200,17 +200,16 @@ run_ifaddr_callback(PgIfAddrCallback callback, void *c
|
||||
/* Check that the mask is valid */
|
||||
if (mask)
|
||||
{
|
||||
- if (mask->sa_family != addr->sa_family)
|
||||
+
|
||||
+ /* mask->sa_family can be different from addr->sa_family. */
|
||||
+
|
||||
+ if (addr->sa_family == AF_INET)
|
||||
{
|
||||
- mask = NULL;
|
||||
- }
|
||||
- else if (mask->sa_family == AF_INET)
|
||||
- {
|
||||
if (((struct sockaddr_in *) mask)->sin_addr.s_addr == INADDR_ANY)
|
||||
mask = NULL;
|
||||
}
|
||||
#ifdef HAVE_IPV6
|
||||
- else if (mask->sa_family == AF_INET6)
|
||||
+ else if (addr->sa_family == AF_INET6)
|
||||
{
|
||||
if (IN6_IS_ADDR_UNSPECIFIED(&((struct sockaddr_in6 *) mask)->sin6_addr))
|
||||
mask = NULL;
|
Loading…
Add table
Add a link
Reference in a new issue