mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Improve logging of DNS record source from --hostsdir files.
Patch author Dominik Derigs <dl6er@dl6er.de> with subsequent bugfixes and tweaks from Simon Kelley.
This commit is contained in:
committed by
Simon Kelley
parent
a176cf1bc3
commit
0ba25a0512
@@ -1861,6 +1861,7 @@ void dump_cache(time_t now)
|
||||
char *record_source(unsigned int index)
|
||||
{
|
||||
struct hostsfile *ah;
|
||||
struct dyndir *dd;
|
||||
|
||||
if (index == SRC_CONFIG)
|
||||
return "config";
|
||||
@@ -1872,9 +1873,11 @@ char *record_source(unsigned int index)
|
||||
return ah->fname;
|
||||
|
||||
#ifdef HAVE_INOTIFY
|
||||
for (ah = daemon->dynamic_dirs; ah; ah = ah->next)
|
||||
if (ah->index == index)
|
||||
return ah->fname;
|
||||
/* Dynamic directories contain multiple files */
|
||||
for (dd = daemon->dynamic_dirs; dd; dd = dd->next)
|
||||
for (ah = dd->files; ah; ah = ah->next)
|
||||
if (ah->index == index)
|
||||
return ah->fname;
|
||||
#endif
|
||||
|
||||
return "<unknown>";
|
||||
|
||||
Reference in New Issue
Block a user