[dhcp-forwarder/f14/master] - backported patch from 0.9 which allows to run dhcp-fwd and e.g. dnsmasq simultaneously on the sa

ensc ensc at fedoraproject.org
Mon Jan 3 21:14:14 UTC 2011


commit 44f8ee17a1e5be315de41bf3de4e93d5005b865e
Author: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
Date:   Mon Jan 3 22:13:29 2011 +0100

    - backported patch from 0.9 which allows to run dhcp-fwd and e.g. dnsmasq
      simultaneously on the same host

 dhcp-forwarder.spec |    8 +++++++-
 reuseaddr.patch     |   30 ++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletions(-)
---
diff --git a/dhcp-forwarder.spec b/dhcp-forwarder.spec
index 56872a6..5cb737e 100644
--- a/dhcp-forwarder.spec
+++ b/dhcp-forwarder.spec
@@ -22,12 +22,13 @@
 Summary:	DHCP relay agent
 Name:		dhcp-forwarder
 Version:	0.8
-Release:	%release_func 1300
+Release:	%release_func 1400
 License:	GPLv3
 Group:		System Environment/Daemons
 URL:		http://www.tu-chemnitz.de/~ensc/dhcp-fwd
 Source0:	http://www.tu-chemnitz.de/~ensc/dhcp-fwd/files/%name-%version.tar.bz2
 Source1:	http://www.tu-chemnitz.de/~ensc/dhcp-fwd/files/%name-%version.tar.bz2.asc
+Patch0:		reuseaddr.patch
 BuildRoot:	%_tmppath/%name-%version-%release-root
 Requires:	init(%name)
 BuildRequires:	which
@@ -111,6 +112,7 @@ with the minit initconcept.
 
 %prep
 %setup -q
+%patch0 -p1
 
 
 %build
@@ -207,6 +209,10 @@ test "$1" != "0" || /sbin/initctl -q stop dhcp-forwarder || :
 
 
 %changelog
+* Mon Jan  3 2011 Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de> - 0.8-1400
+- backported patch from 0.9 which allows to run dhcp-fwd and e.g. dnsmasq
+  simultaneously on the same host
+
 * Sun Dec  6 2009 Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de> - 0.8-1300
 - updated -upstart to upstart 0.6.3
 
diff --git a/reuseaddr.patch b/reuseaddr.patch
new file mode 100644
index 0000000..f33a835
--- /dev/null
+++ b/reuseaddr.patch
@@ -0,0 +1,30 @@
+commit 479fb8e5aca35c757f234dc646fb0358509cb786
+Author: Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
+Date:   Tue Dec 14 21:41:02 2010 +0100
+
+    set SO_REUSEADDR for client sockets
+    
+    This allows to run dhcp-forwarder and a dhcp server like dnsmasq (with
+    'bind-interfaces' option) on the same host.
+    
+    Patch was provided by Stefan Keller <sk at open.ch>.
+
+diff --git a/src/cfg.c b/src/cfg.c
+index 24cd9ea..04e171d 100644
+--- a/src/cfg.c
++++ b/src/cfg.c
+@@ -1,4 +1,4 @@
+-// Copyright (C) 2002, 2003, 2004, 2008
++// Copyright (C) 2002, 2003, 2004, 2008, 2010
+ //               Enrico Scholz <enrico.scholz at informatik.tu-chemnitz.de>
+ //
+ // This program is free software; you can redistribute it and/or modify
+@@ -93,6 +93,8 @@ initClientFD(struct FdInfo *fd,
+   Esetsockopt(fd->fd, SOL_SOCKET, SO_BINDTODEVICE, iface->name,
+ 	      MAX(strlen(iface->name)+1,sizeof(int)));
+ 
++  Esetsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &ON, sizeof ON);
++
+   memset(&s, 0, sizeof(s));
+ 
+     /*@-type@*/


More information about the scm-commits mailing list