summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2017-03-14 12:58:37 -0600
committerJo-Philipp Wich <jo@mein.io>2017-06-02 00:06:24 +0200
commit78edfff5303533dc52a1ac64ad745acc0a8a743e (patch)
tree986e1cbae1b5a224c5feb7eeb76b58ff763fbdb1
parentb1257d8d73690b0e4aac1eed654f5b1b0679bacd (diff)
downloadmtk-20170518-78edfff5303533dc52a1ac64ad745acc0a8a743e.zip
mtk-20170518-78edfff5303533dc52a1ac64ad745acc0a8a743e.tar.gz
mtk-20170518-78edfff5303533dc52a1ac64ad745acc0a8a743e.tar.bz2
dnsmasq: don't point --resolv-file to default location unconditionally
If noresolv is set, we should not generate a --resolv-file parameter. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [minor cleanup]
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init6
1 files changed, 3 insertions, 3 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index bac5fd7..e811a20 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -532,7 +532,7 @@ dhcp_relay_add() {
dnsmasq_start()
{
- local cfg="$1" disabled
+ local cfg="$1" disabled resolvfile
config_get_bool disabled "$cfg" disabled 0
[ "$disabled" -gt 0 ] && return 0
@@ -612,7 +612,6 @@ dnsmasq_start()
config_list_foreach "$cfg" "addnhosts" append_addnhosts
config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain
append_parm "$cfg" "leasefile" "--dhcp-leasefile" "/tmp/dhcp.leases"
- append_parm "$cfg" "resolvfile" "--resolv-file" "/tmp/resolv.conf.auto"
append_parm "$cfg" "serversfile" "--servers-file"
append_parm "$cfg" "tftp_root" "--tftp-root"
append_parm "$cfg" "dhcp_boot" "--dhcp-boot"
@@ -627,7 +626,6 @@ dnsmasq_start()
config_get_bool readethers "$cfg" readethers
[ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers
- config_get resolvfile $cfg resolvfile
config_get dhcpscript $cfg dhcpscript
config_get leasefile $cfg leasefile "/tmp/dhcp.leases"
@@ -641,6 +639,8 @@ dnsmasq_start()
[ -n "$resolvfile" -a \! -e "$resolvfile" ] && touch "$resolvfile"
fi
+ [ -n "$resolvfile" ] && xappend "--resolv-file=$resolvfile"
+
config_get hostsfile "$cfg" dhcphostsfile
[ -e "$hostsfile" ] && xappend "--dhcp-hostsfile=$hostsfile"