Re: BUG #6494: Listening to * fails for IP V6

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #6494: Listening to * fails for IP V6
Дата
Msg-id 1443.1330531376@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #6494: Listening to * fails for IP V6  (Curd Reinert <Curd.Reinert@ppi.de>)
Ответы Re: BUG #6494: Listening to * fails for IP V6  (Curd Reinert <Curd.Reinert@ppi.de>)
Список 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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: BUG #6489: Alter table with composite type/table
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #6497: Error sent to client, but data written anyway