From owner-svn-src-head@FreeBSD.ORG Tue Mar 24 17:47:25 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 141AD106575F; Tue, 24 Mar 2009 17:47:25 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 020448FC1E; Tue, 24 Mar 2009 17:47:25 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2OHlO8x052494; Tue, 24 Mar 2009 17:47:24 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2OHlOdZ052493; Tue, 24 Mar 2009 17:47:24 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <200903241747.n2OHlOdZ052493@svn.freebsd.org> From: Hajimu UMEMOTO Date: Tue, 24 Mar 2009 17:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190382 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 17:47:27 -0000 Author: ume Date: Tue Mar 24 17:47:24 2009 New Revision: 190382 URL: http://svn.freebsd.org/changeset/base/190382 Log: getaddrinfo(3) should accept numeric when ai_socktype is not specified in hint or hints is NULL. PR: bin/51827 Submitted by: Mark Andrews MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Tue Mar 24 17:22:10 2009 (r190381) +++ head/lib/libc/net/getaddrinfo.c Tue Mar 24 17:47:24 2009 (r190382) @@ -1347,7 +1347,17 @@ get_port(struct addrinfo *ai, const char allownumeric = 1; break; case ANY: - allownumeric = 0; + switch (ai->ai_family) { + case AF_INET: +#ifdef AF_INET6 + case AF_INET6: +#endif + allownumeric = 1; + break; + default: + allownumeric = 0; + break; + } break; default: return EAI_SOCKTYPE;