]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/patches/dnsmasq/0045-Fixup-dhcp-configs-after-reading-extra-hostfiles-wit.patch
dnsmasq: Import latest git version of dnsmasq
[ipfire-2.x.git] / src / patches / dnsmasq / 0045-Fixup-dhcp-configs-after-reading-extra-hostfiles-wit.patch
diff --git a/src/patches/dnsmasq/0045-Fixup-dhcp-configs-after-reading-extra-hostfiles-wit.patch b/src/patches/dnsmasq/0045-Fixup-dhcp-configs-after-reading-extra-hostfiles-wit.patch
new file mode 100644 (file)
index 0000000..fc1b98a
--- /dev/null
@@ -0,0 +1,38 @@
+From 2941d3ac898cf84b544e47c9735c5e4111711db1 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon@thekelleys.org.uk>
+Date: Mon, 2 Feb 2015 22:36:42 +0000
+Subject: [PATCH 45/55] Fixup dhcp-configs after reading extra hostfiles with
+ inotify.
+
+---
+ src/inotify.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/src/inotify.c b/src/inotify.c
+index 470d6ed99213..6f4cd79e0030 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)
+                     {
+-- 
+2.1.0
+