[syslog-ng] syslog-ng dnscache.c patch

Steven McDougall smcdougall at sicortex.com
Tue Jan 29 19:59:44 CET 2008


We enabled dns caching with a configuration like 
dns_cache_hosts(/etc/hosts),
and found that syslog-ng was re-reading the hosts file every time it 
needed to resolve a host name.
This patch fixed it.


diff -ru syslog-ng-2.0.6/src/dnscache.c syslog-ng-2.0.6-patch/src/dnscache.c
--- syslog-ng-2.0.6/src/dnscache.c      2007-04-19 15:37:16.000000000 -0400
+++ syslog-ng-2.0.6-patch/src/dnscache.c        2008-01-26 
19:45:31.000000000 -0500
@@ -168,7 +168,9 @@
       if (hosts)
         {
           gchar buf[4096];
-
+
+         dns_cache_hosts_mtime = st.st_mtime;
+
           while (fgets(buf, sizeof(buf), hosts))
             {
               gchar *p, *ip;



More information about the syslog-ng mailing list