Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Mar 2009 17:47:24 +0000 (UTC)
From:      Hajimu UMEMOTO <ume@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190382 - head/lib/libc/net
Message-ID:  <200903241747.n2OHlOdZ052493@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <marka__at__isc.org>
  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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903241747.n2OHlOdZ052493>