Review request: fix return value of socket(2) on no family found

Gleb Smirnoff glebius at FreeBSD.org
Thu Dec 6 16:48:55 UTC 2012


  Kevin,

On Thu, Dec 06, 2012 at 02:39:11PM +0800, Kevin Lo wrote:
K> Here's the patch mostly from NetBSD to make socket(2) return EAFNOSUPPORT
K> rather than EPROTONOSUPPORT if the family cannot be found.
K> 
K> http://people.freebsd.org/~kevlo/patch-socket
K> 
K> The man page documents the behavior specified in POSIX.1-2008:
K> 
K> http://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html
K> 
K> For reference, Linux, NetBSD, and OS X return EAFNOSUPPORT for this.

IMO, the proposed change is correct.

I'd suggest only couple of things:

- Please commit the addition of the pffinddomain() function and its
  documentation separately from socket() return value change.

- May be it is worth to have a comment with reference to POSIX in
  the code in uipc_socket.c, that selects approptiate error value.

-- 
Totus tuus, Glebius.


More information about the freebsd-net mailing list