Re: Bogus bind() warnings

From: Kurt Roeckx <Q(at)ping(dot)be>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Bogus bind() warnings
Date: 2003-11-06 22:17:57
Message-ID: 20031106221757.GA3053@ping.be
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2003-11-06 22:18:13 Re: [HACKERS] Changes to Contributor List
Previous Message Peter Eisentraut 2003-11-06 22:15:57 Re: Changes to Contributor List