]> git.ipfire.org Git - people/ms/dnsmasq.git/commitdiff
Fixup dhcp-configs after reading extra hostfiles with inotify.
authorSimon Kelley <simon@thekelleys.org.uk>
Mon, 2 Feb 2015 22:36:42 +0000 (22:36 +0000)
committerSimon Kelley <simon@thekelleys.org.uk>
Mon, 2 Feb 2015 22:36:42 +0000 (22:36 +0000)
src/inotify.c

index 470d6ed992136f1a1dd7b3a522c490754344ee03..6f4cd79e003025cbf2df940c2ec735f16e821b63 100644 (file)
@@ -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)
                      {