Subject: Re: No IPv6 in the kernel vs socket(2) errno vs postfix
To: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
From: Sean Boudreau <seanb@qnx.com>
List: tech-net
Date: 06/09/2006 09:34:59
On Fri, Jun 09, 2006 at 05:16:59PM +0400, Valeriy E. Ushakov wrote:
> I've tried to enable postfix on a machine w/out IPv6 support in the
> kernel and it died with "socket: Protocol not supported".
> 
> I think there are two issues here
> 
> 1) we return wrong errno.  To quote
>    http://www.fefe.de/libowfat/changes-0.23.txt
> 
>     work around freebsd 5.4 brokenness (if you don't have IPv6 in the
>     kernel, socket(PF_INET6,SOCK_STREAM,0) returns EPROTONOSUPPORT
>     instead of EPFNOSUPPORT, which basically says "yeah, I know IPv6,
>     but TCP?  never heard of it")
> 
> 2) postfix checks for *another* wrong errno: EAFNOSUPPORT instead of
>    EPFNOSUPPORT (search for the former in src/util/inet_proto.c)
> 
> 
> PS: Please, keep me Cc'ed, I'm not subscribed to tech-net@

POSIX says EAFNOSUPPORT and has no concept of EPFNOSUPPORT.

-seanb