From 05f5ac1f08dfe0d8f7216390a103ec58788c8ef9 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 14 Jan 2015 22:02:31 +0100 Subject: [PATCH] os utils: Fixed a typo in the UDP resolver implementation. --- src/utils/os.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.30.2