From owner-freebsd-net@FreeBSD.ORG Thu Dec 6 06:39:13 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8493512B for ; Thu, 6 Dec 2012 06:39:13 +0000 (UTC) (envelope-from kevlo@kevlo.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 058B78FC08 for ; Thu, 6 Dec 2012 06:39:12 +0000 (UTC) Received: from srg.kevlo.org (git.kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.5/8.14.5) with ESMTP id qB66d15M051618 for ; Thu, 6 Dec 2012 14:39:01 +0800 (CST) (envelope-from kevlo@kevlo.org) Message-ID: <50C03D8F.3090106@kevlo.org> Date: Thu, 06 Dec 2012 14:39:11 +0800 From: Kevin Lo User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: freebsd-net@freebsd.org Subject: Review request: fix return value of socket(2) on no family found Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Dec 2012 06:39:13 -0000 Hi, Here's the patch mostly from NetBSD to make socket(2) return EAFNOSUPPORT rather than EPROTONOSUPPORT if the family cannot be found. http://people.freebsd.org/~kevlo/patch-socket The man page documents the behavior specified in POSIX.1-2008: http://pubs.opengroup.org/onlinepubs/9699919799/functions/socket.html For reference, Linux, NetBSD, and OS X return EAFNOSUPPORT for this. Kevin