mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-10-28 12:40:47 +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:
1 parent
a176cf1bc3
commit
0ba25a0512
4 files changed
+119
-65
No files matched your search
+6
-3
@@ -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