From d30e73d0d9e93a747298da1be0415b1a4b20ed61 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 26 Jun 2019 17:17:31 +0200 Subject: [PATCH] nameserv: request SOCK_DGRAM socktype Specify SOCK_DGRAM socktype instead of SOCK_STREAM in hints for getaddrinfo() as chronyd is (and will mainly be) using the returned addresses to open UDP sockets. This shouldn't make a difference in practice, but it might avoid some confusion. --- nameserv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nameserv.c b/nameserv.c index 90a65b1..97b47f8 100644 --- a/nameserv.c +++ b/nameserv.c @@ -69,7 +69,7 @@ DNS_Name2IPAddress(const char *name, IPAddr *ip_addrs, int max_addrs) default: hints.ai_family = AF_UNSPEC; } - hints.ai_socktype = SOCK_STREAM; + hints.ai_socktype = SOCK_DGRAM; result = getaddrinfo(name, NULL, &hints, &res);