From: Tom Lane <tgl@sss.pgh.pa.us>
To: Curd Reinert <Curd.Reinert@ppi.de>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6494: Listening to * fails for IP V6
Date: Wed, 29 Feb 2012 11:02:56 -0500
Message-ID: <1443.1330531376@sss.pgh.pa.us> (raw)
In-Reply-To: <OF0A9D3A97.D35BC0AE-ONC12579B2.00581B6B-C12579B3.0036BE5D@ppi.de>
References: <OF4D41BDCD.FBF104D0-ONC12579B1.006337FF-C12579B1.00633ED9@LocalDomain>
<OF0A9D3A97.D35BC0AE-ONC12579B2.00581B6B-C12579B3.0036BE5D@ppi.de>
Curd Reinert <Curd.Reinert@ppi.de> writes:
> The trouble is that under AIX, once you have bound an IP V4 socket to a
> port, it seems you can't bind a IP V6 socket to the same port. The other
> way round works. And AIX seems to return addrinfo with IP V4 addresses in
> front.
Seems like that is a bug to file with IBM.
> What I did is that I doubled the loop in pqcomm.c. In the first run, I
> only consider IP V6. In the second, I tried the rest. This worked, and I
> was able to connect to the IP V4 and the IP V6 address.
> Since it doesn't harm with other OSes to bind IP V6 first, does it seem to
> you like a sensible way of fixing this?
No. Aside from the code uglification, it seems to me that trying
addresses in an order different from the way that getaddrinfo returns
them is very likely to expose other corner-case misbehaviors in other
operating systems.
Can you work around this with a suitable setting of listen_addresses?
That is, explicitly specify the V6 and then V4 addresses there?
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, Curd.Reinert@ppi.de
Subject: Re: BUG #6494: Listening to * fails for IP V6
In-Reply-To: <1443.1330531376@sss.pgh.pa.us>
References: <OF4D41BDCD.FBF104D0-ONC12579B1.006337FF-C12579B1.00633ED9@LocalDomain> <OF0A9D3A97.D35BC0AE-ONC12579B2.00581B6B-C12579B3.0036BE5D@ppi.de> <1443.1330531376@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox