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.
This commit is contained in:
Miroslav Lichvar 2019-06-26 17:17:31 +02:00
parent 9e7a7008de
commit d30e73d0d9

View file

@ -69,7 +69,7 @@ DNS_Name2IPAddress(const char *name, IPAddr *ip_addrs, int max_addrs)
default: default:
hints.ai_family = AF_UNSPEC; hints.ai_family = AF_UNSPEC;
} }
hints.ai_socktype = SOCK_STREAM; hints.ai_socktype = SOCK_DGRAM;
result = getaddrinfo(name, NULL, &hints, &res); result = getaddrinfo(name, NULL, &hints, &res);