Re: Bogus bind() warnings - Mailing list pgsql-hackers

From Kurt Roeckx
Subject Re: Bogus bind() warnings
Date
Msg-id 20031106221757.GA3053@ping.be
Whole thread Raw
In response to Re: Bogus bind() warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Bogus bind() warnings  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Thu, Nov 06, 2003 at 03:42:39PM -0500, Tom Lane wrote:
> >> Is it possible that that kernel considers binding to an IPv6 port to
> >> conflict with binding to the "same" port number as an IPv4 port?
> 
> Actually, I think that that may be expected behavior depending on the
> vintage of the kernel.  Note the following comment in
> StreamServerPort():
> 
>         /*
>          * Note: This might fail on some OS's, like Linux older than
>          * 2.4.21-pre3, that don't have the IPV6_V6ONLY socket option, and
>          * map ipv4 addresses to ipv6.    It will show ::ffff:ipv4 for all
>          * ipv4 connections.
>          */

Maybe my comment isn't clear enough ...

It fails on Linux in case you first bind the AF_INET6 socket to
::, and then try to bind to AF_INET 0.0.0.0, and don't have the
IPV6_V6ONLY options.

You have this problem from the moment you enable ipv6 support in
your kernel.

The real fix is to get a kernel/libc that has the IPV6_V6ONLY
socket option.

Being unable to bind to the port isn't a problem in case you
already got the AF_INET6 one.  But maybe it might confuse some
users who then think something is wrong.

Should we just not give that error message, in case we already
binded to AF_INET6 ::?


Kurt



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [pgsql-advocacy] Changes to Contributor List
Next
From: Peter Eisentraut
Date:
Subject: Re: [pgsql-www] Changes to Contributor List