pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #6494: Listening to * fails for IP V6
6+ messages / 3 participants
[nested] [flat]
* BUG #6494: Listening to * fails for IP V6
@ 2012-02-27 18:01 curd.reinert@ppi.de
0 siblings, 0 replies; 6+ messages in thread
From: curd.reinert@ppi.de @ 2012-02-27 18:01 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 6494
Logged by: Curd Reinert
Email address: curd.reinert@ppi.de
PostgreSQL version: 9.0.7
Operating system: AIX
Description:
Hello everyone,
on a AIX with IP V6 enabled, I try to listen on all interfaces
listen_addresses = '*'
and get
LOG: could not bind IPv6 socket: Der Socket-Name wird bereits verwendet.
HINT: Is another postmaster already running on port 5432? If not, wait a
few seconds and retry.
Of course I made sure there was nothing running on that port. I can then
connect to the database using 127.0.0.1, but not with ::1.
If instead I specify the IP addresses explictly,
listen_addresses = '127.0.0.1,fdeb:df42:ebda:0815:0:0:0:18,::1'
then there is no error and I can connect to all the addresses. 'localhost'
instead of '*' also works, but I want to connect remotely.
It's a 9.0.7 which was build on AIX 5.3 with readline, zlib and
thread-safety disabled. The machine I originally tried to run it is a AIX
6.1. Symptoms on the 5.3 are the same.
We only have this trouble on AIX. We are already connection succesfully
remotely over IP V6 to database running on Linux, Solaris, and Windows 7 (as
far as I know).
I didn't find anything useful in FAQ or TODO, I hope I didn't miss something
obvious.
Many thanks,
Curd
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #6494: Listening to * fails for IP V6
@ 2012-02-29 09:57 Curd Reinert <Curd.Reinert@ppi.de>
2012-02-29 16:02 ` Re: BUG #6494: Listening to * fails for IP V6 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 6+ messages in thread
From: Curd Reinert @ 2012-02-29 09:57 UTC (permalink / raw)
To: pgsql-bugs
Hello again,
since we've had similar trouble without own server sockets, I had a deeper
look into this one.
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.
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?
Best regards,
Curd
Von: Curd Reinert/HH/PPI
An: Curd Reinert/HH/PPI@PPI
Datum: 27.02.2012 19:04
Betreff: Listening to * fails for IP V6
Hello everyone,
on a AIX with IP V6 enabled, I try to listen on all interfaces
listen_addresses = '*'
and get
LOG: could not bind IPv6 socket: Der Socket-Name wird bereits verwendet.
HINT: Is another postmaster already running on port 5432? If not, wait a
few seconds and retry.
Of course I made sure there was nothing running on that port. I can then
connect to the database using 127.0.0.1, but not with ::1.
If instead I specify the IP addresses explictly,
listen_addresses = '127.0.0.1,fdeb:df42:ebda:0815:0:0:0:18,::1'
then there is no error and I can connect to all the addresses. 'localhost'
instead of '*' also works, but I want to connect remotely.
It's a 9.0.7 which was build on AIX 5.3 with readline, zlib and
thread-safety disabled. The machine I originally tried to run it is a AIX
6.1. Symptoms on the 5.3 are the same.
We only have this trouble on AIX. We are already connection succesfully
remotely over IP V6 to database running on Linux, Solaris, and Windows 7
(as far as I know).
I didn't find anything useful in FAQ or TODO, I hope I didn't miss
something obvious.
Many thanks,
Curd
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #6494: Listening to * fails for IP V6
2012-02-29 09:57 Re: BUG #6494: Listening to * fails for IP V6 Curd Reinert <Curd.Reinert@ppi.de>
@ 2012-02-29 16:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-03-01 11:00 ` Re: BUG #6494: Listening to * fails for IP V6 Curd Reinert <Curd.Reinert@ppi.de>
0 siblings, 1 reply; 6+ messages in thread
From: Tom Lane @ 2012-02-29 16:02 UTC (permalink / raw)
To: Curd Reinert <Curd.Reinert@ppi.de>; +Cc: pgsql-bugs
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
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #6494: Listening to * fails for IP V6
2012-02-29 09:57 Re: BUG #6494: Listening to * fails for IP V6 Curd Reinert <Curd.Reinert@ppi.de>
2012-02-29 16:02 ` Re: BUG #6494: Listening to * fails for IP V6 Tom Lane <tgl@sss.pgh.pa.us>
@ 2012-03-01 11:00 ` Curd Reinert <Curd.Reinert@ppi.de>
0 siblings, 0 replies; 6+ messages in thread
From: Curd Reinert @ 2012-03-01 11:00 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs; pgsql-bugs-owner@postgresql.org
pgsql-bugs-owner@postgresql.org schrieb am 29.02.2012 17:02:56:
> 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.
I agree. I will try to narrow it down to a simple example and send it to
IBM.
> code uglification,
I agree with that one, too.
> Can you work around this with a suitable setting of listen_addresses?
> That is, explicitly specify the V6 and then V4 addresses there?
Not really. Postgres is runnning at our customers sites, we don't know how
there networks are configured, and we don't know if IP addresses may
change. All we could do is describe the problem as a known bug when using
AIX, IPV6 and postgres together and explain the workaround.
Many thanks,
Curd
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #6494: Listening to * fails for IP V6
@ 2012-08-08 08:20 Curd Reinert <Curd.Reinert@ppi.de>
0 siblings, 0 replies; 6+ messages in thread
From: Curd Reinert @ 2012-08-08 08:20 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs
Tom Lane wrote:
>> 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.
Indeed it does, and we did. Took us some time to persuade IBM to really
check this, and some more time until we got an answer. The good news: they
agree that the current behaviour is faulty, and they will change it. The
not so good news: they can't predict when this fix will be available.
If you happen to have an account at IBM, you can read more about IV23320
here: http://www-01.ibm.com/support/docview.wss?uid=isg1IV23320
Best regards,
Curd Reinert
^ permalink raw reply [nested|flat] 6+ messages in thread
* Re: BUG #6494: Listening to * fails for IP V6
@ 2012-11-02 13:23 Curd Reinert <Curd.Reinert@ppi.de>
0 siblings, 0 replies; 6+ messages in thread
From: Curd Reinert @ 2012-11-02 13:23 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-bugs
Hi Tom and everyone,
> Seems like that is a bug to file with IBM.
We did this 8 months ago, and we got a patch for the problem yesterday. As
far as we can see it's really fixed - I only tested it with the showcase
we built to convince IBM that there really is a problem, I haven't tried
yet with postgres, but I'm pretty much convinced that it will work now.
lslpp -l sh shows the following version information: bos.net.tcp.client
6.1.8.0 COMMITTED TCP/IP Client Support
Thanks for your help,
Curd
^ permalink raw reply [nested|flat] 6+ messages in thread
end of thread, other threads:[~2012-11-02 13:23 UTC | newest]
Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-02-27 18:01 BUG #6494: Listening to * fails for IP V6 curd.reinert@ppi.de
2012-02-29 09:57 Re: BUG #6494: Listening to * fails for IP V6 Curd Reinert <Curd.Reinert@ppi.de>
2012-02-29 16:02 ` Tom Lane <tgl@sss.pgh.pa.us>
2012-03-01 11:00 ` Curd Reinert <Curd.Reinert@ppi.de>
2012-08-08 08:20 Re: BUG #6494: Listening to * fails for IP V6 Curd Reinert <Curd.Reinert@ppi.de>
2012-11-02 13:23 Re: BUG #6494: Listening to * fails for IP V6 Curd Reinert <Curd.Reinert@ppi.de>
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