From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthias Fischer To: development@lists.ipfire.org Subject: [PATCH] dnsmasq 276test8: latest patch from upstream (003) Date: Fri, 05 Feb 2016 23:24:24 +0100 Message-ID: <1454711064-25537-1-git-send-email-matthias.fischer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2827045556195904889==" List-Id: --===============2827045556195904889== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Added latest patch from upstream: http://thekelleys.org.uk/gitweb/?p=3Ddnsmasq.git;a=3Dcommit;h=3D1566bacb2c687= 081028c52f162b598b8a09ae844 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=3Dpeople/ms/dnsmasq.git;a=3Dcommitdiff;h=3Dbac82b4ff= 2f971a0227efb1a83f2b2bb1cd28764 Signed-off-by: Matthias Fischer --- 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_IPV= 6_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_name= s_of_ARP_script_actions_consistent.patch + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq/003-Fix_break= age_in_ARP_code_when_IPV6_support_not_compiled_in.patch cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/dnsmasq-Add-support-t= o-read-ISC-DHCP-lease-file.patch =20 cd $(DIR_APP) && sed -i src/config.h \ diff --git a/src/patches/dnsmasq-Add-support-to-read-ISC-DHCP-lease-file.patc= h 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 @@ =20 --- 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 @@ =20 poll_resolv(0, daemon->last_resolv !=3D 0, now); =20 daemon->last_resolv =3D now; @@ -56,7 +56,7 @@ =20 --- 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); =20 @@ -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 ++#include ++ +#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 =3D whine_malloc(sizeof(*lease)); ++ if (!lease) ++ return NULL; + + lease->name =3D strdup(hostname); + if (daemon->domain_suffix) { -+ asprintf(&lease->fqdn, "%s.%s", hostname, daemon->domain_suffix); ++ int r =3D asprintf(&lease->fqdn, "%s.%s", hostname, daemon->= domain_suffix); ++ ++ // Handle OOM ++ if (r < 0) { ++ free(lease); ++ return NULL; ++ } + } + lease->expires =3D 0; + lease->next =3D NULL; @@ -285,6 +298,7 @@ + // and append it to the list. + if (!lease) { + lease =3D dhcp_lease_new(hostname); ++ assert(lease); + + lease->next =3D leases; + leases =3D 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; =20 diff --git a/src/patches/dnsmasq/003-Fix_breakage_in_ARP_code_when_IPV6_suppo= rt_not_compiled_in.patch b/src/patches/dnsmasq/003-Fix_breakage_in_ARP_code_w= hen_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 +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; +=20 ++#ifndef HAVE_IPV6 ++ if (family !=3D AF_INET) ++ return 1; ++#endif ++ + /* Look for existing entry */ + for (arp =3D arps; arp; arp =3D 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, g= id_t gid, long max_fd) + =20 + 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 +--=20 +1.7.10.4 + --=20 2.7.0 --===============2827045556195904889==--