Added latest patch from upstream: http://thekelleys.org.uk/gitweb/?p=dnsmasq.git;a=commit;h=1566bacb2c68708102...
Changed file 'dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch', integrated patch for 'isc.c' "...to suppress a compiler warning".
For details see: http://git.ipfire.org/?p=people/ms/dnsmasq.git;a=commitdiff;h=bac82b4ff2f971...
Signed-off-by: Matthias Fischer matthias.fischer@ipfire.org --- lfs/dnsmasq | 1 + ...q-Add-support-to-read-ISC-DHCP-lease-file.patch | 24 ++++++++++--- ...RP_code_when_IPV6_support_not_compiled_in.patch | 42 ++++++++++++++++++++++ 3 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 src/patches/dnsmasq/003-Fix_breakage_in_ARP_code_when_IPV6_support_not_compiled_in.patch
diff --git a/lfs/dnsmasq b/lfs/dnsmasq index e4af9d5..b9ddf12 100644 --- a/lfs/dnsmasq +++ b/lfs/dnsmasq @@ -75,6 +75,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar axf $(DIR_DL)/$(DL_FILE) cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/001-Fix_FTBFS_on_illumos.patch cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/002-Make_names_of_ARP_script_actions_consistent.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-Fix_breakage_in_ARP_code_when_IPV6_support_not_compiled_in.patch cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch
cd $(DIR_APP) && sed -i src/config.h \ diff --git a/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch b/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch index e49366a..f1abbd0 100644 --- a/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch +++ b/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patch @@ -42,7 +42,7 @@
--- a/src/dnsmasq.c Thu Jul 30 20:59:06 2015 +++ b/src/dnsmasq.c Wed Dec 16 19:38:32 2015 -@@ -1010,6 +1010,11 @@ +@@ -1013,6 +1013,11 @@
poll_resolv(0, daemon->last_resolv != 0, now); daemon->last_resolv = now; @@ -56,7 +56,7 @@
--- a/src/dnsmasq.h Wed Dec 16 19:24:12 2015 +++ b/src/dnsmasq.h Wed Dec 16 19:40:11 2015 -@@ -1510,6 +1510,11 @@ +@@ -1511,6 +1511,11 @@ void poll_listen(int fd, short event); int do_poll(int timeout);
@@ -72,7 +72,7 @@ - --- /dev/null Wed Dec 16 19:48:08 2015 +++ b/src/isc.c Wed Dec 16 19:41:35 2015 -@@ -0,0 +1,251 @@ +@@ -0,0 +1,265 @@ +/* dnsmasq is Copyright (c) 2014 John Volpe, Simon Kelley and + Michael Tremer + @@ -96,6 +96,11 @@ + +#include "dnsmasq.h" + ++#define _GNU_SOURCE ++ ++#include <assert.h> ++#include <stdio.h> ++ +#ifdef HAVE_ISC_READER +#define MAXTOK 50 + @@ -109,10 +114,18 @@ + +static struct isc_dhcp_lease* dhcp_lease_new(const char* hostname) { + struct isc_dhcp_lease* lease = whine_malloc(sizeof(*lease)); ++ if (!lease) ++ return NULL; + + lease->name = strdup(hostname); + if (daemon->domain_suffix) { -+ asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix); ++ int r = asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix); ++ ++ // Handle OOM ++ if (r < 0) { ++ free(lease); ++ return NULL; ++ } + } + lease->expires = 0; + lease->next = NULL; @@ -285,6 +298,7 @@ + // and append it to the list. + if (!lease) { + lease = dhcp_lease_new(hostname); ++ assert(lease); + + lease->next = leases; + leases = lease; @@ -326,7 +340,7 @@ +#endif --- a/src/option.c Wed Dec 16 19:24:12 2015 +++ b/src/option.c Wed Dec 16 19:42:48 2015 -@@ -1760,7 +1760,7 @@ +@@ -1763,7 +1763,7 @@ ret_err(_("bad MX target")); break;
diff --git a/src/patches/dnsmasq/003-Fix_breakage_in_ARP_code_when_IPV6_support_not_compiled_in.patch b/src/patches/dnsmasq/003-Fix_breakage_in_ARP_code_when_IPV6_support_not_compiled_in.patch new file mode 100644 index 0000000..8df4afe --- /dev/null +++ b/src/patches/dnsmasq/003-Fix_breakage_in_ARP_code_when_IPV6_support_not_compiled_in.patch @@ -0,0 +1,42 @@ +From 1566bacb2c687081028c52f162b598b8a09ae844 Mon Sep 17 00:00:00 2001 +From: Simon Kelley simon@thekelleys.org.uk +Date: Fri, 5 Feb 2016 14:38:06 +0000 +Subject: [PATCH] Fix breakage in ARP code when IPV6 support not compiled in. + +--- + src/arp.c | 5 +++++ + src/helper.c | 2 +- + 2 files changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/arp.c b/src/arp.c +index 3e347ae..318430e 100644 +--- a/src/arp.c ++++ b/src/arp.c +@@ -44,6 +44,11 @@ static int filter_mac(int family, char *addrp, char *mac, size_t maclen, void *p + if (maclen > DHCP_CHADDR_MAX) + return 1; + ++#ifndef HAVE_IPV6 ++ if (family != AF_INET) ++ return 1; ++#endif ++ + /* Look for existing entry */ + for (arp = arps; arp; arp = arp->next) + { +diff --git a/src/helper.c b/src/helper.c +index 0afee46..9c37e37 100644 +--- a/src/helper.c ++++ b/src/helper.c +@@ -300,7 +300,7 @@ int create_helper(int event_fd, int err_fd, uid_t uid, gid_t gid, long max_fd) + + if (!is6) + inet_ntop(AF_INET, &data.addr, daemon->addrbuff, ADDRSTRLEN); +-#ifdef HAVE_DHCP6 ++#ifdef HAVE_IPV6 + else + inet_ntop(AF_INET6, &data.addr6, daemon->addrbuff, ADDRSTRLEN); + #endif +-- +1.7.10.4 +