[source] dnsmasq: make bind-dynamic 'non-wildcard' interfaces default

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 11 05:50:15 PDT 2017


dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/16a905b322306aefa331d8a93a9e191582afe2b1

commit 16a905b322306aefa331d8a93a9e191582afe2b1
Author: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
AuthorDate: Fri Feb 24 10:08:30 2017 +0000

    dnsmasq: make bind-dynamic 'non-wildcard' interfaces default
    
    'non-wildcard' interfaces enables dnsmasq's '--bind-dynamic' mode.  This
    binds to interfaces rather than wildcard addresses *and* keeps track of
    interface comings/goings via a unique Linux api.
    
    Quoting dnsmasq's author "bind-dynamic (bind individual addresses, keep
    up with changes in interface config) ... On linux, there's actually no
    sane reason not to use --bind-dynamic, and it's only not the default for
    historical reasons."
    
    Let's change history, well on LEDE at least, and change the default!
    
    Signed-off-by: Kevin Darbyshire-Bryant <kevin at darbyshire-bryant.me.uk>
---
 package/network/services/dnsmasq/Makefile           | 2 +-
 package/network/services/dnsmasq/files/dhcp.conf    | 2 +-
 package/network/services/dnsmasq/files/dnsmasq.init | 6 ++++--
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 5b1073f..f9ab13a 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.77
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/files/dhcp.conf b/package/network/services/dnsmasq/files/dhcp.conf
index 362b90a..360c7d7 100644
--- a/package/network/services/dnsmasq/files/dhcp.conf
+++ b/package/network/services/dnsmasq/files/dhcp.conf
@@ -15,7 +15,7 @@ config dnsmasq
 	option leasefile	'/tmp/dhcp.leases'
 	option resolvfile	'/tmp/resolv.conf.auto'
 	#list server		'/mycompany.local/1.2.3.4'
-	#option nonwildcard	1
+	option nonwildcard	1 # bind to & keep track of interfaces
 	#list interface		br-lan
 	#list notinterface	lo
 	#list bogusnxdomain     '64.94.110.11'
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 2d05b77..d5177ec 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -103,8 +103,10 @@ append_bool() {
 	local section="$1"
 	local option="$2"
 	local value="$3"
+	local default="$4"
 	local _loctmp
-	config_get_bool _loctmp "$section" "$option" 0
+	[ -z "$default" ] && default="0"
+	config_get_bool _loctmp "$section" "$option" "$default"
 	[ $_loctmp -gt 0 ] && xappend "$value"
 }
 
@@ -791,7 +793,7 @@ dnsmasq_start()
 	config_get tftp_root "$cfg" "tftp_root"
 	[ -n "$tftp_root" ] && mkdir -p "$tftp_root" && append_bool "$cfg" enable_tftp "--enable-tftp"
 	append_bool "$cfg" tftp_no_fail "--tftp-no-fail"
-	append_bool "$cfg" nonwildcard "--bind-dynamic"
+	append_bool "$cfg" nonwildcard "--bind-dynamic" 1
 	append_bool "$cfg" fqdn "--dhcp-fqdn"
 	append_bool "$cfg" proxydnssec "--proxy-dnssec"
 	append_bool "$cfg" localservice "--local-service"



More information about the lede-commits mailing list