]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/dnsmasq/0050-Make-dynamic-hosts-files-work-when-no-hosts-set.patch
af79802025299aafb2b55b44670fcdfb26c3971b
[ipfire-2.x.git] / src / patches / dnsmasq / 0050-Make-dynamic-hosts-files-work-when-no-hosts-set.patch
1 From caeea190f12efd20139f694aac4942d1ac00019f Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Sat, 14 Feb 2015 20:08:56 +0000
4 Subject: [PATCH 50/55] Make dynamic hosts files work when --no-hosts set.
5
6 ---
7 src/cache.c | 21 +++++++++++----------
8 1 file changed, 11 insertions(+), 10 deletions(-)
9
10 diff --git a/src/cache.c b/src/cache.c
11 index 43245b771b53..c95624c42b1c 100644
12 --- a/src/cache.c
13 +++ b/src/cache.c
14 @@ -1133,17 +1133,18 @@ void cache_reload(void)
15 {
16 if (daemon->cachesize > 0)
17 my_syslog(LOG_INFO, _("cleared cache"));
18 - return;
19 }
20 -
21 - if (!option_bool(OPT_NO_HOSTS))
22 - total_size = read_hostsfile(HOSTSFILE, SRC_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
23 -
24 - daemon->addn_hosts = expand_filelist(daemon->addn_hosts);
25 - for (ah = daemon->addn_hosts; ah; ah = ah->next)
26 - if (!(ah->flags & AH_INACTIVE))
27 - total_size = read_hostsfile(ah->fname, ah->index, total_size, (struct crec **)daemon->packet, revhashsz);
28 -
29 + else
30 + {
31 + if (!option_bool(OPT_NO_HOSTS))
32 + total_size = read_hostsfile(HOSTSFILE, SRC_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
33 +
34 + daemon->addn_hosts = expand_filelist(daemon->addn_hosts);
35 + for (ah = daemon->addn_hosts; ah; ah = ah->next)
36 + if (!(ah->flags & AH_INACTIVE))
37 + total_size = read_hostsfile(ah->fname, ah->index, total_size, (struct crec **)daemon->packet, revhashsz);
38 + }
39 +
40 #ifdef HAVE_INOTIFY
41 set_dynamic_inotify(AH_HOSTS, total_size, (struct crec **)daemon->packet, revhashsz);
42 #endif
43 --
44 2.1.0
45