From: Sebastian Harl Date: Wed, 14 Jan 2015 21:02:31 +0000 (+0100) Subject: os utils: Fixed a typo in the UDP resolver implementation. X-Git-Tag: sysdb-0.7.0~72 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=05f5ac1f08dfe0d8f7216390a103ec58788c8ef9;p=sysdb.git os utils: Fixed a typo in the UDP resolver implementation. --- diff --git a/src/utils/os.c b/src/utils/os.c index d8f7074..4afc466 100644 --- a/src/utils/os.c +++ b/src/utils/os.c @@ -286,6 +286,7 @@ sdb_resolve(int network, const char *address, struct addrinfo **res) ai_hints.ai_family = AF_INET6; else ai_hints.ai_family = AF_UNSPEC; + if ((network & SDB_NET_IP) == SDB_NET_IP) { ai_hints.ai_socktype = 0; ai_hints.ai_protocol = 0; @@ -296,7 +297,7 @@ sdb_resolve(int network, const char *address, struct addrinfo **res) } else if (network & SDB_NET_UDP) { ai_hints.ai_socktype = SOCK_DGRAM; - ai_hints.ai_socktype = IPPROTO_UDP; + ai_hints.ai_protocol = IPPROTO_UDP; } status = getaddrinfo(host, port, &ai_hints, res);