From c63c98a6067030a25a42703db1209ccbcc74803a Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 7 Feb 2015 14:01:34 -0500 Subject: make getaddrinfo support SOCK_RAW and other socket types all socket types are accepted at this point, but that may be changed at a later time if the behavior is not meaningful for other types. as before, omitting type (a value of 0) gives both UDP and TCP results, and SOCK_DGRAM or SOCK_STREAM restricts to UDP or TCP, respectively. for other socket types, the service name argument is required to be a null pointer, and the protocol number provided by the caller is used. --- src/network/getservbyname_r.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/network/getservbyname_r.c') diff --git a/src/network/getservbyname_r.c b/src/network/getservbyname_r.c index 8cdf622c..056c2f33 100644 --- a/src/network/getservbyname_r.c +++ b/src/network/getservbyname_r.c @@ -26,7 +26,7 @@ int getservbyname_r(const char *name, const char *prots, else if (!strcmp(prots, "udp")) proto = IPPROTO_UDP; else return EINVAL; - cnt = __lookup_serv(servs, name, proto, 0); + cnt = __lookup_serv(servs, name, proto, 0, 0); if (cnt<0) switch (cnt) { case EAI_MEMORY: case EAI_SYSTEM: -- cgit v1.2.1