]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
nameserv: request SOCK_DGRAM socktype
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 26 Jun 2019 15:17:31 +0000 (17:17 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Wed, 26 Jun 2019 15:21:47 +0000 (17:21 +0200)
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

index 90a65b19540d96e203e894280f91fd0e4fca5208..97b47f8897b707d320b430044164d107a2053e4c 100644 (file)
@@ -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);