From: Rui Salvaterra Date: Thu, 8 Jul 2021 10:33:07 +0000 (+0100) Subject: dnsmasq: add a new "bind" configuration option X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=995b855b1bb79bf83e46303c0316ce10a8dd041f;p=openwrt%2Fstaging%2Fjow.git dnsmasq: add a new "bind" configuration option The nonwildcard option only allows to choose between the default behaviour (bind to the wildcard address only, which unfeasible when running multiple instances of dnsmasq) and --bind-dynamic (bind to any existing/new interfaces which aren't explicitly configured otherwise). Add a new "bind" option, which can take the value of "dynamic" or "interfaces", allowing the user to additionally choose the --bind-interfaces behaviour (bind only to explicitly configured interfaces). The dnsmasq man page [1] contains more detailed information about these arguments. Finally, the nonwildcard option is kept for backwards compatibility. [1] https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html Signed-off-by: Rui Salvaterra --- diff --git a/package/network/services/dnsmasq/files/dhcp.conf b/package/network/services/dnsmasq/files/dhcp.conf index d5b9dfa018..3ebae43486 100644 --- a/package/network/services/dnsmasq/files/dhcp.conf +++ b/package/network/services/dnsmasq/files/dhcp.conf @@ -16,7 +16,7 @@ config dnsmasq option leasefile '/tmp/dhcp.leases' option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto' #list server '/mycompany.local/1.2.3.4' - option nonwildcard 1 # bind to & keep track of interfaces + option bind 'dynamic' # 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 2249548092..bb75fa31ed 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -982,7 +982,18 @@ 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" 1 + + config_get bind "$cfg" "bind" + case "$bind" in + dynamic|interfaces) + xappend "--bind-$bind" + ;; + "") + # for compatibility reasons + append_bool "$cfg" nonwildcard "--bind-dynamic" 1 + ;; + esac + append_bool "$cfg" fqdn "--dhcp-fqdn" append_bool "$cfg" proxydnssec "--proxy-dnssec" append_bool "$cfg" localservice "--local-service"