Subject: Re: 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 18:09:46
On Fri, Jun 09, 2006 at 09:34:59 -0400, Sean Boudreau wrote:

> > 2) postfix checks for *another* wrong errno: EAFNOSUPPORT instead of
> >    EPFNOSUPPORT (search for the former in src/util/inet_proto.c)
> 
> POSIX says EAFNOSUPPORT and has no concept of EPFNOSUPPORT.

Well, POSIX doesn't have PF_ constants either.  We nominally
distinguish PF_ and AF_ though they have identical numeric values, but
EPFNOSUPPORT and EAFNOSUPPORT have different numeric values, thus we
have an interesting problem here (posixly correct vs internally
consistent).

Anyway, my reading of the
http://www.opengroup.org/onlinepubs/007908799/xns/socket.html is that
unsupported arguments should be reported as:

domain   - EAFNOSUPPORT (EPFNOSUPPORT)
type     - EPROTOTYPE
protocol - EPROTONOSUPPORT

pffindproto and pffindtype return NULL w/out indicating which argument
caused the problem.

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