Skip to content

Commit 9771125

Browse files
committed
Fix recent changes to not break non-IPV6-aware systems.
1 parent 33ae03f commit 9771125

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/backend/libpq/hba.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,8 @@ ipv4eq(struct sockaddr_in *a, struct sockaddr_in *b)
548548
return (a->sin_addr.s_addr == b->sin_addr.s_addr);
549549
}
550550

551+
#ifdef HAVE_IPV6
552+
551553
static bool
552554
ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
553555
{
@@ -560,6 +562,8 @@ ipv6eq(struct sockaddr_in6 *a, struct sockaddr_in6 *b)
560562
return true;
561563
}
562564

565+
#endif /* HAVE_IPV6 */
566+
563567
/*
564568
* Check to see if a connecting IP matches a given host name.
565569
*/
@@ -614,6 +618,7 @@ check_hostname(hbaPort *port, const char *hostname)
614618
break;
615619
}
616620
}
621+
#ifdef HAVE_IPV6
617622
else if (gai->ai_addr->sa_family == AF_INET6)
618623
{
619624
if (ipv6eq((struct sockaddr_in6 *) gai->ai_addr,
@@ -623,6 +628,7 @@ check_hostname(hbaPort *port, const char *hostname)
623628
break;
624629
}
625630
}
631+
#endif
626632
}
627633
}
628634

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy