Subject: No IPv6 in the kernel vs socket(2) errno vs postfix
To: None <tech-net@netbsd.org>
From: Valeriy E. Ushakov <uwe@ptc.spbu.ru>
List: tech-net
Date: 06/09/2006 17:16:59
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@

SY, Uwe
-- 
uwe@ptc.spbu.ru                         |       Zu Grunde kommen
http://snark.ptc.spbu.ru/~uwe/          |       Ist zu Grunde gehen