Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 15df139

Browse files
committed
Original assumption that our own getaddrinfo routine would never support
IPv6 is obsoleted by recent Windows patch. Perform the runtime test whenever HAVE_IPV6 is set. This should be OK since initdb can get getaddrinfo from libpgport if needed.
1 parent c94bbf2 commit 15df139

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/bin/initdb/initdb.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
* Portions Copyright (c) 1994, Regents of the University of California
4343
* Portions taken from FreeBSD.
4444
*
45-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.95 2005/08/22 16:27:36 tgl Exp $
45+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.96 2005/08/25 02:22:59 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -1210,16 +1210,13 @@ setup_config(void)
12101210
conflines = replace_token(conflines,"@remove-line-for-nolocal@","");
12111211
#endif
12121212

1213-
#if defined(HAVE_IPV6) && defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
1213+
#ifdef HAVE_IPV6
12141214
/*
12151215
* Probe to see if there is really any platform support for IPv6, and
12161216
* comment out the relevant pg_hba line if not. This avoids runtime
12171217
* warnings if getaddrinfo doesn't actually cope with IPv6. Particularly
12181218
* useful on Windows, where executables built on a machine with IPv6
12191219
* may have to run on a machine without.
1220-
*
1221-
* We don't bother with testing if we aren't using the system version
1222-
* of getaddrinfo, since we know our own version doesn't do IPv6.
12231220
*/
12241221
{
12251222
struct addrinfo *gai_result;
@@ -1240,12 +1237,12 @@ setup_config(void)
12401237
"host all all ::1",
12411238
"#host all all ::1");
12421239
}
1243-
#else /* !HAVE_IPV6 etc */
1240+
#else /* !HAVE_IPV6 */
12441241
/* If we didn't compile IPV6 support at all, always comment it out */
12451242
conflines = replace_token(conflines,
12461243
"host all all ::1",
12471244
"#host all all ::1");
1248-
#endif /* HAVE_IPV6 etc */
1245+
#endif /* HAVE_IPV6 */
12491246

12501247
/* Replace default authentication methods */
12511248
conflines = replace_token(conflines,

0 commit comments

Comments
 (0)