summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Kelley <simon@thekelleys.org.uk>2015-02-02 22:36:42 +0000
committerSimon Kelley <simon@thekelleys.org.uk>2015-02-02 22:36:42 +0000
commit2941d3ac898cf84b544e47c9735c5e4111711db1 (patch)
treeac47d50edf7110b3025ae1175009c3d2363957d4
parentd36b732c4cfa91ea09af64b5dc0f3a85a075e5bc (diff)
downloaddnsmasq-2941d3ac898cf84b544e47c9735c5e4111711db1.tar.gz
Fixup dhcp-configs after reading extra hostfiles with inotify.
-rw-r--r--src/inotify.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/inotify.c b/src/inotify.c
index 470d6ed..6f4cd79 100644
--- a/src/inotify.c
+++ b/src/inotify.c
@@ -194,7 +194,19 @@ int inotify_check(time_t now)
strcat(path, in->name);
if (ah->flags & AH_HOSTS)
- read_hostsfile(path, ah->index, 0, NULL, 0);
+ {
+ read_hostsfile(path, ah->index, 0, NULL, 0);
+#ifdef HAVE_DHCP
+ if (daemon->dhcp || daemon->doing_dhcp6)
+ {
+ /* Propogate the consequences of loading a new dhcp-host */
+ dhcp_update_configs(daemon->dhcp_conf);
+ lease_update_from_configs();
+ lease_update_file(now);
+ lease_update_dns(1);
+ }
+#endif
+ }
#ifdef HAVE_DHCP
else if (ah->flags & AH_DHCP_HST)
{