dnsmasq: latest pre-2.81 patches
authorKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Fri, 18 Jan 2019 08:56:59 +0000 (08:56 +0000)
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Thu, 31 Jan 2019 10:13:05 +0000 (10:13 +0000)
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
33 files changed:
package/network/services/dnsmasq/Makefile
package/network/services/dnsmasq/patches/0001-Impove-cache-behaviour-for-TCP-connections.patch
package/network/services/dnsmasq/patches/0002-Ensure-that-AD-bit-is-reset-on-answers-from-address-.patch
package/network/services/dnsmasq/patches/0003-Remove-ability-to-compile-without-IPv6-support.patch
package/network/services/dnsmasq/patches/0004-Don-t-forward-.bind-.server-queries-upstream.patch
package/network/services/dnsmasq/patches/0005-Fix-logging-in-cf5984367bc6a949e3803a576512c5a7bc48e.patch
package/network/services/dnsmasq/patches/0006-Fix-spurious-AD-flags-in-some-DNS-replies-from-local.patch
package/network/services/dnsmasq/patches/0007-Do-not-rely-on-dead-code-elimination-use-array-inste.patch
package/network/services/dnsmasq/patches/0008-Fix-Makefile-lines-generating-UBUS-linker-config.patch
package/network/services/dnsmasq/patches/0009-Revert-68f6312d4bae30b78daafcd6f51dc441b8685b1e.patch
package/network/services/dnsmasq/patches/0010-Remove-the-NO_FORK-compile-time-option-and-support-f.patch
package/network/services/dnsmasq/patches/0011-Free-config-file-values-on-parsing-errors.patch
package/network/services/dnsmasq/patches/0013-Treat-DS-and-DNSKEY-queries-being-forwarded-the-same.patch
package/network/services/dnsmasq/patches/0014-Fix-option-parsing-errors-introduced-in-59e470381f84.patch
package/network/services/dnsmasq/patches/0015-fix-ipv6-ipset-bug-in-master.patch
package/network/services/dnsmasq/patches/0016-build-failure-on-master-with-NO_DHCPv6-and-fix.patch
package/network/services/dnsmasq/patches/0017-Alter-DHCP-address-selection-after-DECLINE-in-consec.patch
package/network/services/dnsmasq/patches/0018-Tidy-all_addr-union-merge-log-and-rcode-fields.patch
package/network/services/dnsmasq/patches/0019-Tidy-address-union-handling-move-class-into-explicit.patch
package/network/services/dnsmasq/patches/0020-Futher-address-union-tidying.patch
package/network/services/dnsmasq/patches/0021-Remove-nested-struct-union-in-cache-records-and-all_.patch
package/network/services/dnsmasq/patches/0022-File-logic-bug-in-cache-marshalling-code.-Introduced.patch
package/network/services/dnsmasq/patches/0023-Fix-typo-in-ra-param-man-page-section.patch
package/network/services/dnsmasq/patches/0024-Cache-SRV-records.patch
package/network/services/dnsmasq/patches/0025-Fix-crash-freeing-negative-SRV-cache-entries.patch
package/network/services/dnsmasq/patches/0026-Check-for-not-DS-or-DNSKEY-in-is_outdated_cname_poin.patch
package/network/services/dnsmasq/patches/0027-Fix-e7bfd556c079c8b5e7425aed44abc35925b24043-to-actu.patch
package/network/services/dnsmasq/patches/0028-Tidy-cache_blockdata_free.patch
package/network/services/dnsmasq/patches/0029-Fix-removal-of-DHCP_CLIENT_MAC-options-from-DHCPv6-r.patch
package/network/services/dnsmasq/patches/0030-Fix-entries-in-etc-hosts-disabling-static-leases.patch
package/network/services/dnsmasq/patches/0031-Fix-missing-braces-in-8eac67c0a15b673c8d27002c248651.patch [new file with mode: 0644]
package/network/services/dnsmasq/patches/0031-fix-previous-commit.patch [deleted file]
package/network/services/dnsmasq/patches/0032-Change-read_leases-to-skip-invalid-entries.patch [new file with mode: 0644]

index a3a0b12..03114e7 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.80
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq
index 5c13bf9..c801f25 100644 (file)
@@ -1,7 +1,7 @@
 From a799ca0c6314ad73a97bc6c89382d2712a9c0b0e Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Thu, 18 Oct 2018 19:35:29 +0100
-Subject: [PATCH 01/30] Impove cache behaviour for TCP connections.
+Subject: [PATCH 01/32] Impove cache behaviour for TCP connections.
 
 For ease of implementaion, dnsmasq has always forked a new process to
 handle each incoming TCP connection. A side-effect of this is that any
index b23766d..0a115fe 100644 (file)
@@ -1,7 +1,7 @@
 From a220545c4277cba534be5ef4638b5076fc7d2cf4 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Mon, 22 Oct 2018 18:21:48 +0100
-Subject: [PATCH 02/30] Ensure that AD bit is reset on answers from
+Subject: [PATCH 02/32] Ensure that AD bit is reset on answers from
  --address=/<domain>/<address>.
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
index 352d071..527a38d 100644 (file)
@@ -1,7 +1,7 @@
 From ee8750451b49d27b180517a4e35b636be0fae575 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Tue, 23 Oct 2018 22:10:17 +0100
-Subject: [PATCH 03/30] Remove ability to compile without IPv6 support.
+Subject: [PATCH 03/32] Remove ability to compile without IPv6 support.
 
 This was the source of a large number of #ifdefs, originally
 included for use with old embedded libc versions. I'm
index cf59309..cbf211a 100644 (file)
@@ -1,7 +1,7 @@
 From cf5984367bc6a949e3803a576512c5a7bc48ebab Mon Sep 17 00:00:00 2001
 From: Vladislav Grishenko <themiron@mail.ru>
 Date: Thu, 18 Oct 2018 04:55:21 +0500
-Subject: [PATCH 04/30] Don't forward *.bind/*.server queries upstream
+Subject: [PATCH 04/32] Don't forward *.bind/*.server queries upstream
 
 Chaos .bind and .server (RFC4892) zones are local, therefore
 don't forward queries upstream to avoid mixing with supported
index 0281a2c..473297b 100644 (file)
@@ -1,7 +1,7 @@
 From cbb5b17ad8e03e08ade62376a4f6a2066e55960d Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Tue, 23 Oct 2018 23:45:57 +0100
-Subject: [PATCH 05/30] Fix logging in cf5984367bc6a949e3803a576512c5a7bc48ebab
+Subject: [PATCH 05/32] Fix logging in cf5984367bc6a949e3803a576512c5a7bc48ebab
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
 ---
index 0433cca..bebc7ba 100644 (file)
@@ -1,7 +1,7 @@
 From 6f7812d97bc8f87004c0a5069c6c94c64af78106 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Tue, 23 Oct 2018 23:54:44 +0100
-Subject: [PATCH 06/30] Fix spurious AD flags in some DNS replies from local
+Subject: [PATCH 06/32] Fix spurious AD flags in some DNS replies from local
  config.
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
index c1c674f..7934792 100644 (file)
@@ -1,7 +1,7 @@
 From 24b87607c1353e94689e8a2190571ab3f3b36f31 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
 Date: Wed, 24 Oct 2018 22:30:18 +0100
-Subject: [PATCH 07/30] Do not rely on dead code elimination, use array
+Subject: [PATCH 07/32] Do not rely on dead code elimination, use array
  instead. Make options bits derived from size and count. Use size of option
  bits and last supported bit in computation. No new change would be required
  when new options are added. Just change OPT_LAST constant.
index 9c00291..766aad2 100644 (file)
@@ -1,7 +1,7 @@
 From 3a5a84cdd1488bad118eeac72d09a60299bca744 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Wed, 31 Oct 2018 21:30:13 +0000
-Subject: [PATCH 08/30] Fix Makefile lines generating UBUS linker config.
+Subject: [PATCH 08/32] Fix Makefile lines generating UBUS linker config.
 
 If arg2 of pkg-wrapper is "--copy", then arg1 is NOT the name of
 the package manager (--copy doesn't invoke it) it's a secondary
index dcbfc3d..32468ae 100644 (file)
@@ -1,7 +1,7 @@
 From 122392e0b352507cabb9e982208d35d2e56902e0 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Wed, 31 Oct 2018 22:24:02 +0000
-Subject: [PATCH 09/30] Revert 68f6312d4bae30b78daafcd6f51dc441b8685b1e
+Subject: [PATCH 09/32] Revert 68f6312d4bae30b78daafcd6f51dc441b8685b1e
 
 The above is intended to increase robustness, but actually does the
 opposite. The problem is that by ignoring SERVFAIL messages and hoping
index 2aa4ae7..78f31d0 100644 (file)
@@ -1,7 +1,7 @@
 From 48d12f14c9c0fc8cf943b52774c3892517dd72d4 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Fri, 2 Nov 2018 21:55:04 +0000
-Subject: [PATCH 10/30] Remove the NO_FORK compile-time option, and support for
+Subject: [PATCH 10/32] Remove the NO_FORK compile-time option, and support for
  uclinux.
 
 In an era where everything has an MMU, this looks like
index 9609376..0b53b30 100644 (file)
@@ -1,7 +1,7 @@
 From 59e470381f84f2fdf0640c7bc67827f3f0c64784 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
 Date: Fri, 2 Nov 2018 22:39:39 +0000
-Subject: [PATCH 11/30] Free config file values on parsing errors.
+Subject: [PATCH 11/32] Free config file values on parsing errors.
 
 This time I have a little bit more controversal patches. But I think
 still useful. They fixes memory leaks that might occur in some cases.
index d0f59de..7053d03 100644 (file)
@@ -1,7 +1,7 @@
 From 07e25da5bf26d46aad4f1d2eb19b260789182004 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Sun, 16 Dec 2018 18:21:58 +0000
-Subject: [PATCH 13/30] Treat DS and DNSKEY queries being forwarded the same as
+Subject: [PATCH 13/32] Treat DS and DNSKEY queries being forwarded the same as
  those locally originated.
 
 The queries will not be forwarded to a server for a domain, unless
index a38ca33..2aaf382 100644 (file)
@@ -1,7 +1,7 @@
 From 137e9f878fafb38369eab7d9dfe84e4228ff5f89 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= <pemensik@redhat.com>
 Date: Sun, 16 Dec 2018 21:25:29 +0000
-Subject: [PATCH 14/30] Fix option parsing errors introduced in
+Subject: [PATCH 14/32] Fix option parsing errors introduced in
  59e470381f84f2fdf0640c7bc67827f3f0c64784
 
 Thanks to Kevin Darbyshire-Bryant for spotting this.
index daf0ed6..920cf75 100644 (file)
@@ -1,7 +1,7 @@
 From 3becf468bad699bfdcb2d18d553bc72d4c79e23c Mon Sep 17 00:00:00 2001
 From: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
 Date: Wed, 12 Dec 2018 12:00:19 +0000
-Subject: [PATCH 15/30] fix ipv6 ipset bug in master
+Subject: [PATCH 15/32] fix ipv6 ipset bug in master
 MIME-Version: 1.0
 Content-Type: text/plain; charset=UTF-8
 Content-Transfer-Encoding: 8bit
index ac13de4..e4e363b 100644 (file)
@@ -1,7 +1,7 @@
 From b683cf37f9f3dd3dc5d95d621ee75850d559b2e4 Mon Sep 17 00:00:00 2001
 From: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
 Date: Mon, 10 Dec 2018 10:34:35 +0000
-Subject: [PATCH 16/30] build failure on master with NO_DHCPv6 and fix....
+Subject: [PATCH 16/32] build failure on master with NO_DHCPv6 and fix....
 
 Hi Simon,
 
index ef8b78a..1a3b341 100644 (file)
@@ -1,7 +1,7 @@
 From e7bfd556c079c8b5e7425aed44abc35925b24043 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Mon, 31 Dec 2018 20:51:15 +0000
-Subject: [PATCH 17/30] Alter DHCP address selection after DECLINE in
+Subject: [PATCH 17/32] Alter DHCP address selection after DECLINE in
  consec-addr mode. Avoid offering the same address after a recieving a DECLINE
  message to stop an infinite protocol loop. This has long been done in default
  address allocation mode: this adds similar behaviour when allocaing addresses
index cd9d022..e6b456f 100644 (file)
@@ -1,7 +1,7 @@
 From bde46476ee06c96e821653dfdb8fa11fe7326998 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Mon, 31 Dec 2018 23:28:24 +0000
-Subject: [PATCH 18/30] Tidy all_addr union, merge log and rcode fields.
+Subject: [PATCH 18/32] Tidy all_addr union, merge log and rcode fields.
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
 ---
index 883202d..4854617 100644 (file)
@@ -1,7 +1,7 @@
 From 65a01b71bb433c9466e4c78a73a8d8ed218ed4e8 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Mon, 31 Dec 2018 23:56:33 +0000
-Subject: [PATCH 19/30] Tidy address-union handling: move class into explicit
+Subject: [PATCH 19/32] Tidy address-union handling: move class into explicit
  argument.
 
 This moves the class argument to cache-insert into an argument,
index a5f17ec..deda82f 100644 (file)
@@ -1,7 +1,7 @@
 From ab194ed7ca433e4e2e8b2ec338bfa4e6aa886a4b Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Tue, 1 Jan 2019 01:35:30 +0000
-Subject: [PATCH 20/30] Futher address union tidying.
+Subject: [PATCH 20/32] Futher address union tidying.
 
 Pass DNSKEY and DS data into cache_insert via the address argument,
 now these data types are included in struct all_addr.
index 4377cc1..360e8a4 100644 (file)
@@ -1,7 +1,7 @@
 From cc921df9ceac79acf9f1c477d015a3d88275422d Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Wed, 2 Jan 2019 22:48:59 +0000
-Subject: [PATCH 21/30] Remove nested struct/union in cache records and
+Subject: [PATCH 21/32] Remove nested struct/union in cache records and
  all_addr.
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
index 92944fa..32a02cd 100644 (file)
@@ -1,7 +1,7 @@
 From 2c594732eb7391e7cfa817598e33e61cab71131f Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Thu, 3 Jan 2019 13:42:03 +0000
-Subject: [PATCH 22/30] File logic bug in cache-marshalling code. Introduced a
+Subject: [PATCH 22/32] File logic bug in cache-marshalling code. Introduced a
  couple of commits back.
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
index ecc060e..48343af 100644 (file)
@@ -1,7 +1,7 @@
 From 2daca52b80afdc92e7c976629a2bf8182335a626 Mon Sep 17 00:00:00 2001
 From: Christian Weiske <cweiske@cweiske.de>
 Date: Thu, 3 Jan 2019 20:10:14 +0000
-Subject: [PATCH 23/30] Fix typo in ra-param man page section.
+Subject: [PATCH 23/32] Fix typo in ra-param man page section.
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
 ---
index dec3b82..d38d30e 100644 (file)
@@ -1,7 +1,7 @@
 From 5b99eae59d59a8e34a7e512059b98bbd803312f2 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Sun, 6 Jan 2019 23:09:50 +0000
-Subject: [PATCH 24/30] Cache SRV records.
+Subject: [PATCH 24/32] Cache SRV records.
 
 Inpsired by a patch from Jeremy Allison, but completely re-rolled
 by srk. All bugs are mine.
index ec4d52d..424574b 100644 (file)
@@ -1,7 +1,7 @@
 From a90f09db4cc635941a32b973b57e58c662569625 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Wed, 9 Jan 2019 15:08:16 +0000
-Subject: [PATCH 25/30] Fix crash freeing negative SRV cache entries.
+Subject: [PATCH 25/32] Fix crash freeing negative SRV cache entries.
 
 Thanks to Daniel for finding this one.
 
index b84a928..4ca0be4 100644 (file)
@@ -1,7 +1,7 @@
 From 2896e2485e44c04e73a0b7c9f7cbc9c8515d0800 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Wed, 9 Jan 2019 15:12:34 +0000
-Subject: [PATCH 26/30] Check for not(DS or DNSKEY) in
+Subject: [PATCH 26/32] Check for not(DS or DNSKEY) in
  is_outdated_cname_pointer()
 
 Previous check was _for_ IPV4, IPv6 CNAME, and I missed adding SRV.
index 180a030..63d5baa 100644 (file)
@@ -1,7 +1,7 @@
 From 9c0d445ef4abffa2b9342ad65e85ef425c1f83bb Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Wed, 9 Jan 2019 17:57:56 +0000
-Subject: [PATCH 27/30] Fix e7bfd556c079c8b5e7425aed44abc35925b24043 to
+Subject: [PATCH 27/32] Fix e7bfd556c079c8b5e7425aed44abc35925b24043 to
  actually work.
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
index ed8170c..8aa69a7 100644 (file)
@@ -1,7 +1,7 @@
 From 4bf62f616b82fad7a7f91195b0204dd64d79a35c Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Thu, 10 Jan 2019 21:54:22 +0000
-Subject: [PATCH 28/30] Tidy cache_blockdata_free()
+Subject: [PATCH 28/32] Tidy cache_blockdata_free()
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
 ---
index d8ae0e7..e02bd11 100644 (file)
@@ -1,7 +1,7 @@
 From f8c77edbdffb8ada7753ea9fa104f0f6da70cfe3 Mon Sep 17 00:00:00 2001
 From: Simon Kelley <simon@thekelleys.org.uk>
 Date: Thu, 10 Jan 2019 21:58:18 +0000
-Subject: [PATCH 29/30] Fix removal of DHCP_CLIENT_MAC options from DHCPv6
+Subject: [PATCH 29/32] Fix removal of DHCP_CLIENT_MAC options from DHCPv6
  relay replies.
 
 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
index 265bd3f..00f2102 100644 (file)
@@ -1,7 +1,7 @@
 From 18eac67c0a15b673c8d27002c248651b308093e4 Mon Sep 17 00:00:00 2001
 From: Steven Siloti <ssiloti@gmail.com>
 Date: Sun, 13 Jan 2019 22:56:36 +0000
-Subject: [PATCH 30/30] Fix entries in /etc/hosts disabling static leases.
+Subject: [PATCH 30/32] Fix entries in /etc/hosts disabling static leases.
 
 It is possible for a config entry to have one address family specified by a
 dhcp-host directive and the other added from /etc/hosts. This is especially
diff --git a/package/network/services/dnsmasq/patches/0031-Fix-missing-braces-in-8eac67c0a15b673c8d27002c248651.patch b/package/network/services/dnsmasq/patches/0031-Fix-missing-braces-in-8eac67c0a15b673c8d27002c248651.patch
new file mode 100644 (file)
index 0000000..928c6ee
--- /dev/null
@@ -0,0 +1,28 @@
+From d2d49907435433001ab00698a3e9ca2a7b5b3236 Mon Sep 17 00:00:00 2001
+From: Steven Siloti <ssiloti@gmail.com>
+Date: Thu, 17 Jan 2019 22:52:13 +0000
+Subject: [PATCH 31/32] Fix missing braces in
+ 8eac67c0a15b673c8d27002c248651b308093e4
+
+Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
+---
+ src/dhcp-common.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/src/dhcp-common.c
++++ b/src/dhcp-common.c
+@@ -371,12 +371,14 @@ void dhcp_update_configs(struct dhcp_con
+   int prot = AF_INET;
+   for (config = configs; config; config = config->next)
++  {
+     if (config->flags & CONFIG_ADDR_HOSTS)
+       config->flags &= ~(CONFIG_ADDR | CONFIG_ADDR_HOSTS);
+ #ifdef HAVE_DHCP6
+     if (config->flags & CONFIG_ADDR6_HOSTS)
+       config->flags &= ~(CONFIG_ADDR6 | CONFIG_ADDR6_HOSTS);
+ #endif
++  }
+ #ifdef HAVE_DHCP6 
+  again:  
diff --git a/package/network/services/dnsmasq/patches/0031-fix-previous-commit.patch b/package/network/services/dnsmasq/patches/0031-fix-previous-commit.patch
deleted file mode 100644 (file)
index d985c4a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-From f52bb5be437ab33d7cd10f0ff1cdf0bb86857cf7 Mon Sep 17 00:00:00 2001
-From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
-Date: Wed, 16 Jan 2019 09:48:07 +0000
-Subject: [PATCH 31/31] fix previous commit
-
-Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
----
- src/dhcp-common.c | 2 ++
- 1 file changed, 2 insertions(+)
-
---- a/src/dhcp-common.c
-+++ b/src/dhcp-common.c
-@@ -371,12 +371,14 @@ void dhcp_update_configs(struct dhcp_con
-   int prot = AF_INET;
-   for (config = configs; config; config = config->next)
-+  {
-     if (config->flags & CONFIG_ADDR_HOSTS)
-       config->flags &= ~(CONFIG_ADDR | CONFIG_ADDR_HOSTS);
- #ifdef HAVE_DHCP6
-     if (config->flags & CONFIG_ADDR6_HOSTS)
-       config->flags &= ~(CONFIG_ADDR6 | CONFIG_ADDR6_HOSTS);
- #endif
-+  }
- #ifdef HAVE_DHCP6 
-  again:  
diff --git a/package/network/services/dnsmasq/patches/0032-Change-read_leases-to-skip-invalid-entries.patch b/package/network/services/dnsmasq/patches/0032-Change-read_leases-to-skip-invalid-entries.patch
new file mode 100644 (file)
index 0000000..bbaed87
--- /dev/null
@@ -0,0 +1,61 @@
+From 28cfe36e1eee9d2c234e0256ad459956b415a3bb Mon Sep 17 00:00:00 2001
+From: Brian Haley <haleyb.dev@gmail.com>
+Date: Thu, 17 Jan 2019 23:21:23 +0000
+Subject: [PATCH 32/32] Change read_leases() to skip invalid entries.
+
+There's no reason to stop reading the existing lease file
+when dnsmasq is started and an invalid entry is found, it
+can just be ignored.  This was fallout from an Openstack
+bug where the file was being written incorrectly with []
+around IPv6 addresses.
+
+Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
+---
+ src/lease.c | 22 +++++++++++++++-------
+ 1 file changed, 15 insertions(+), 7 deletions(-)
+
+--- a/src/lease.c
++++ b/src/lease.c
+@@ -60,8 +60,13 @@ static int read_leases(time_t now, FILE
+       
+       if (fscanf(leasestream, " %64s %255s %764s",
+                  daemon->namebuff, daemon->dhcp_buff, daemon->packet) != 3)
+-        return 0;
+-      
++        {
++          my_syslog(MS_DHCP | LOG_WARNING, _("ignoring invalid line in lease database: %s %s %s %s ..."),
++                    daemon->dhcp_buff3, daemon->dhcp_buff2,
++                    daemon->namebuff, daemon->dhcp_buff);
++          continue;
++        }
++              
+       if (inet_pton(AF_INET, daemon->namebuff, &addr.addr4))
+         {
+           if ((lease = lease4_allocate(addr.addr4)))
+@@ -92,7 +97,12 @@ static int read_leases(time_t now, FILE
+         }
+ #endif
+       else
+-        return 0;
++        {
++          my_syslog(MS_DHCP | LOG_WARNING, _("ignoring invalid line in lease database, bad address: %s"),
++                    daemon->namebuff);
++          continue;
++        }
++      
+       if (!lease)
+         die (_("too many stored leases"), NULL, EC_MISC);
+@@ -172,10 +182,8 @@ void lease_init(time_t now)
+   if (leasestream)
+     {
+       if (!read_leases(now, leasestream))
+-      my_syslog(MS_DHCP | LOG_ERR, _("failed to parse lease database, invalid line: %s %s %s %s ..."),
+-                daemon->dhcp_buff3, daemon->dhcp_buff2,
+-                daemon->namebuff, daemon->dhcp_buff);
+-
++      my_syslog(MS_DHCP | LOG_ERR, _("failed to parse lease database cleanly"));
++      
+       if (ferror(leasestream))
+       die(_("failed to read lease file %s: %s"), daemon->lease_file, EC_FILE);
+     }