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 ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend