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
This commit is contained in:
Hajimu UMEMOTO 2009-03-24 17:47:24 +00:00
parent fffcc698c7
commit d53978e3c0

View file

@ -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;