[source] dnsmasq: peacefully coexist with ISC DHCPd

LEDE Commits lede-commits at lists.infradead.org
Sat Apr 8 08:23:20 PDT 2017


dangole pushed a commit to source.git, branch master:
https://git.lede-project.org/1c42598b7da843f11d5777cecd24be84469952cc

commit 1c42598b7da843f11d5777cecd24be84469952cc
Author: Daniel Golle <daniel at makrotopia.org>
AuthorDate: Wed Apr 5 20:31:01 2017 +0200

    dnsmasq: peacefully coexist with ISC DHCPd
    
    Similar to odhcpd, allow using ISC DHCPd instead of dnsmasq.
    Disable DHCP and/or DHCP6 in case ISC DHCP is present and
    enabled.
    
    Signed-off-by: Daniel Golle <daniel at makrotopia.org>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 5f69be7..83553f1 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -720,6 +720,15 @@ dnsmasq_start()
 		DNSMASQ_DHCP_VER=4
 	fi
 
+	# Allow DHCP/DHCPv6 to be handled by ISC DHCPD
+	if [ -x /usr/sbin/dhcpd ] ; then
+		if [ -x /etc/init.d/dhcpd ] ; then
+			/etc/init.d/dhcpd enabled && DNSMASQ_DHCP_VER=0
+		fi
+		if [ -x /etc/init.d/dhcpd6 -a "$DNSMASQ_DHCP_VER" -gt 0 ] ; then
+			/etc/init.d/dhcpd6 enabled && DNSMASQ_DHCP_VER=4
+		fi
+	fi
 
 	append_bool "$cfg" authoritative "--dhcp-authoritative"
 	append_bool "$cfg" nodaemon "--no-daemon"



More information about the lede-commits mailing list