From: Miroslav Lichvar Date: Wed, 26 Jun 2019 15:17:31 +0000 (+0200) Subject: nameserv: request SOCK_DGRAM socktype X-Git-Tag: 4.0-pre1~186 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d30e73d0d9e93a747298da1be0415b1a4b20ed61;p=thirdparty%2Fchrony.git 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. --- diff --git a/nameserv.c b/nameserv.c index 90a65b19..97b47f88 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);