commit 16e329b64e40d5f7bf98a0f4eaae7092c41e41b7
Author: Tomas Hozza <thozza(a)redhat.com>
Date: Fri Apr 12 09:27:21 2013 +0200
Update to latest dnsmasq-2.66rc5
Also Include fix for segfault when lease limit is reached
Signed-off-by: Tomas Hozza <thozza(a)redhat.com>
.gitignore | 1 +
...5-Fix-crash-on-exceeding-DHCP-lease-limit.patch | 61 ++++++++++++++++++++
dnsmasq.spec | 13 ++++-
sources | 2 +-
4 files changed, 74 insertions(+), 3 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 2d5afa0..66c2e52 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ dnsmasq-2.52.tar.lzma
/dnsmasq-2.64.tar.gz
/dnsmasq-2.65.tar.gz
/dnsmasq-2.66rc1.tar.gz
+/dnsmasq-2.66rc5.tar.gz
diff --git a/dnsmasq-2.66.rc5-Fix-crash-on-exceeding-DHCP-lease-limit.patch
b/dnsmasq-2.66.rc5-Fix-crash-on-exceeding-DHCP-lease-limit.patch
new file mode 100644
index 0000000..8852c55
--- /dev/null
+++ b/dnsmasq-2.66.rc5-Fix-crash-on-exceeding-DHCP-lease-limit.patch
@@ -0,0 +1,61 @@
+From 0b0a73c1c91bef3c2ab60a9563eac69a6b692a25 Mon Sep 17 00:00:00 2001
+From: Simon Kelley <simon(a)thekelleys.org.uk>
+Date: Thu, 11 Apr 2013 14:07:02 +0100
+Subject: [PATCH] Fix crash on exceeding DHCP lease limit.
+
+---
+ CHANGELOG | 4 ++++
+ src/lease.c | 15 +++++++++++----
+ 2 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/CHANGELOG b/CHANGELOG
+index 212d412..b21f10a 100644
+--- a/CHANGELOG
++++ b/CHANGELOG
+@@ -58,6 +58,10 @@ version 2.66
+ Felker for the bug report.
+
+ Update Polish translation. Thanks to Jan Psota.
++
++ Fix crash if the configured DHCP lease limit is
++ reached. Regression occurred in 2.61. Thanks to Tsachi for
++ the bug report.
+
+
+ version 2.65
+diff --git a/src/lease.c b/src/lease.c
+index d30ae80..a4560ba 100644
+--- a/src/lease.c
++++ b/src/lease.c
+@@ -703,8 +703,11 @@ static struct dhcp_lease *lease_allocate(void)
+ struct dhcp_lease *lease4_allocate(struct in_addr addr)
+ {
+ struct dhcp_lease *lease = lease_allocate();
+- lease->addr = addr;
+- lease->hwaddr_len = 256; /* illegal value */
++ if (lease)
++ {
++ lease->addr = addr;
++ lease->hwaddr_len = 256; /* illegal value */
++ }
+
+ return lease;
+ }
+@@ -713,8 +716,12 @@ struct dhcp_lease *lease4_allocate(struct in_addr addr)
+ struct dhcp_lease *lease6_allocate(struct in6_addr *addrp, int lease_type)
+ {
+ struct dhcp_lease *lease = lease_allocate();
+- memcpy(lease->hwaddr, addrp, sizeof(*addrp)) ;
+- lease->flags |= lease_type;
++
++ if (lease)
++ {
++ memcpy(lease->hwaddr, addrp, sizeof(*addrp)) ;
++ lease->flags |= lease_type;
++ }
+
+ return lease;
+ }
+--
+1.8.1.4
+
diff --git a/dnsmasq.spec b/dnsmasq.spec
index 94cfb5f..2cf2be7 100644
--- a/dnsmasq.spec
+++ b/dnsmasq.spec
@@ -6,12 +6,12 @@
%endif
%if 0%{releasecandidate}
%define extrapath release-candidates/
- %define extraversion rc1
+ %define extraversion rc5
%endif
Name: dnsmasq
Version: 2.66
-Release: 1%{?extraversion}%{?dist}
+Release: 1.%{?extraversion}%{?dist}
Summary: A lightweight DHCP/caching DNS server
Group: System Environment/Daemons
@@ -20,6 +20,9 @@ URL:
http://www.thekelleys.org.uk/dnsmasq/
Source0:
http://www.thekelleys.org.uk/dnsmasq/%{?extrapath}%{name}-%{version}%{?ex...
Source1: %{name}.service
+# Upstream fix after dnsmasq-2.66rc5 - commit 56a1142f033234e3ee3b6361e9a1bcdbe606f816
+Patch0: dnsmasq-2.66.rc5-Fix-crash-on-exceeding-DHCP-lease-limit.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: dbus-devel
@@ -54,6 +57,8 @@ query/remove a DHCP server's leases.
%prep
%setup -q -n %{name}-%{version}%{?extraversion}
+%patch0 -p1 -b .lease-limit
+
# use /var/lib/dnsmasq instead of /var/lib/misc
for file in dnsmasq.conf.example man/dnsmasq.8 man/es/dnsmasq.8 src/config.h; do
sed -i 's|/var/lib/misc/dnsmasq.leases|/var/lib/dnsmasq/dnsmasq.leases|g'
"$file"
@@ -133,6 +138,10 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/dhcp_*
%changelog
+* Fri Apr 12 2013 Tomas Hozza <thozza(a)redhat.com> - 2.66-1.rc5
+- Update to latest dnsmasq-2.66rc5
+- Include fix for segfault when lease limit is reached
+
* Fri Mar 22 2013 Tomas Hozza <thozza(a)redhat.com> - 2.66-1.rc1
- Update to latest dnsmasq-2.66rc1
- Dropping unneeded patches
diff --git a/sources b/sources
index 71bfdb1..4f4ade2 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-f1461f0f1c29cce8f92a4534a57003cd dnsmasq-2.66rc1.tar.gz
+9c9fe3f9b0d6afb6a0a5d2f5c4eb1867 dnsmasq-2.66rc5.tar.gz