Re: BUG #6494: Listening to * fails for IP V6 - Mailing list pgsql-bugs

From Curd Reinert
Subject Re: BUG #6494: Listening to * fails for IP V6
Date
Msg-id OF0A9D3A97.D35BC0AE-ONC12579B2.00581B6B-C12579B3.0036BE5D@ppi.de
Whole thread Raw
In response to BUG #6494: Listening to * fails for IP V6  (curd.reinert@ppi.de)
Responses Re: BUG #6494: Listening to * fails for IP V6
List 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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #6497: Error sent to client, but data written anyway
Next
From: Alvaro Herrera
Date:
Subject: Re: BUG #6489: Alter table with composite type/table