Don't use SO_REUSEPORT on DHCPv4 socket to prevent conflicts with ISC DHCP (#981973)

Signed-off-by: Tomas Hozza <thozza@redhat.com>
This commit is contained in:
Tomas Hozza 2013-08-12 15:12:18 +02:00
parent d4631ba788
commit ea5468d6a1
2 changed files with 26 additions and 1 deletions

View File

@ -0,0 +1,17 @@
diff -up dnsmasq-2.66/src/dhcp.c.reuseport dnsmasq-2.66/src/dhcp.c
--- dnsmasq-2.66/src/dhcp.c.reuseport 2013-08-12 14:35:07.575237403 +0200
+++ dnsmasq-2.66/src/dhcp.c 2013-08-12 14:35:48.220273629 +0200
@@ -72,11 +72,13 @@ static int make_fd(int port)
{
int rc = -1, porterr = 0;
+/*
#ifdef SO_REUSEPORT
if ((rc = setsockopt(fd, SOL_SOCKET, SO_REUSEPORT, &oneopt, sizeof(oneopt))) == -1 &&
errno != ENOPROTOOPT)
porterr = 1;
#endif
+*/
if (rc == -1 && !porterr)
rc = setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &oneopt, sizeof(oneopt));

View File

@ -13,7 +13,7 @@
Name: dnsmasq
Version: 2.67
Release: 0.4.%{?extraversion}%{?dist}
Release: 0.5.%{?extraversion}%{?dist}
Summary: A lightweight DHCP/caching DNS server
Group: System Environment/Daemons
@ -22,6 +22,9 @@ URL: http://www.thekelleys.org.uk/dnsmasq/
Source0: http://www.thekelleys.org.uk/dnsmasq/%{?extrapath}%{name}-%{version}%{?extraversion}.tar.gz
Source1: %{name}.service
# Don't use SO_REUSEPORT on DHCPv4 socket to prevent conflicts with ISC DHCP
Patch0: %{name}-2.66-Dont_use_SO_REUSEPORT_on_dhcp4_socket.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: dbus-devel
@ -56,6 +59,8 @@ query/remove a DHCP server's leases.
%prep
%setup -q -n %{name}-%{version}%{?extraversion}
%patch0 -p1 -b .reuseport
# 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"
@ -135,6 +140,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/dhcp_*
%changelog
* Mon Aug 12 2013 Tomas Hozza <thozza@redhat.com> - 2.67-0.5.test7
- Don't use SO_REUSEPORT on DHCPv4 socket to prevent conflicts with ISC DHCP (#981973)
* Sat Aug 03 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.67-0.4.test7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild