mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Make dynamic hosts files work when --no-hosts set.
This commit is contained in:
17
src/cache.c
17
src/cache.c
@@ -1133,16 +1133,17 @@ void cache_reload(void)
|
|||||||
{
|
{
|
||||||
if (daemon->cachesize > 0)
|
if (daemon->cachesize > 0)
|
||||||
my_syslog(LOG_INFO, _("cleared cache"));
|
my_syslog(LOG_INFO, _("cleared cache"));
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!option_bool(OPT_NO_HOSTS))
|
||||||
|
total_size = read_hostsfile(HOSTSFILE, SRC_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
|
||||||
|
|
||||||
if (!option_bool(OPT_NO_HOSTS))
|
daemon->addn_hosts = expand_filelist(daemon->addn_hosts);
|
||||||
total_size = read_hostsfile(HOSTSFILE, SRC_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
|
for (ah = daemon->addn_hosts; ah; ah = ah->next)
|
||||||
|
if (!(ah->flags & AH_INACTIVE))
|
||||||
daemon->addn_hosts = expand_filelist(daemon->addn_hosts);
|
total_size = read_hostsfile(ah->fname, ah->index, total_size, (struct crec **)daemon->packet, revhashsz);
|
||||||
for (ah = daemon->addn_hosts; ah; ah = ah->next)
|
}
|
||||||
if (!(ah->flags & AH_INACTIVE))
|
|
||||||
total_size = read_hostsfile(ah->fname, ah->index, total_size, (struct crec **)daemon->packet, revhashsz);
|
|
||||||
|
|
||||||
#ifdef HAVE_INOTIFY
|
#ifdef HAVE_INOTIFY
|
||||||
set_dynamic_inotify(AH_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
|
set_dynamic_inotify(AH_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
|
||||||
|
|||||||
Reference in New Issue
Block a user