aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHajimu UMEMOTO <ume@FreeBSD.org>2009-03-24 17:47:24 +0000
committerHajimu UMEMOTO <ume@FreeBSD.org>2009-03-24 17:47:24 +0000
commitd53978e3c02e3833042ec455076bce11ffbefc40 (patch)
treebe70ffc5609653ce1d308653b5d5d3cb06d22d76 /lib
parentfffcc698c7fb2d982b416c0ee709f494b07fd580 (diff)
downloadsrc-d53978e3c02e3833042ec455076bce11ffbefc40.tar.gz
src-d53978e3c02e3833042ec455076bce11ffbefc40.zip
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
Notes
Notes: svn path=/head/; revision=190382
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/getaddrinfo.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libc/net/getaddrinfo.c b/lib/libc/net/getaddrinfo.c
index 941c315272da..21ba70e370ad 100644
--- a/lib/libc/net/getaddrinfo.c
+++ b/lib/libc/net/getaddrinfo.c
@@ -1347,7 +1347,17 @@ get_port(struct addrinfo *ai, const char *servname, int matchonly)
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;