]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
privops: reload DNS configuration
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 15 Jan 2016 15:58:12 +0000 (16:58 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 15 Jan 2016 15:58:12 +0000 (16:58 +0100)
The helper process needs to call res_init() before DNS_Name2IPAddress()
in order to see changes in resolv.conf.

privops.c

index 9b4094ad8e95c5f773d5fbafc3eefacd6537595c..30768638dafe26f446c11801d1f0374e115ea06a 100644 (file)
--- a/privops.c
+++ b/privops.c
@@ -291,6 +291,9 @@ do_name_to_ipaddress(ReqName2IPAddress *req, PrvResponse *res)
 {
   /* make sure the string is terminated */
   req->name[sizeof (req->name) - 1] = '\0';
+
+  DNS_Reload();
+
   res->rc = DNS_Name2IPAddress(req->name, res->data.name_to_ipaddress.addresses,
                                DNS_MAX_ADDRESSES);
 }