summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Dedecker <dedeckeh@gmail.com>2018-07-17 13:42:17 +0200
committerKevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>2018-07-28 11:23:57 +0100
commitbf1b0fad2b788f2e933cbe43740402fba5acaf16 (patch)
tree3f21b744547af917b175f278b708f95bcec2c19d
parentcb9d5f0a7cb6125d3fef9e803024a9690b1c56d9 (diff)
downloadmtk-20170518-bf1b0fad2b788f2e933cbe43740402fba5acaf16.zip
mtk-20170518-bf1b0fad2b788f2e933cbe43740402fba5acaf16.tar.gz
mtk-20170518-bf1b0fad2b788f2e933cbe43740402fba5acaf16.tar.bz2
dnsmasq: don't use network functions at boottime (FS#1542)
As dnsmasq is started earlier than netifd usage of network.sh functions at boottime will fail; therefore don't call at boottime the functions which construct the dhcp pool/relay info. As interface triggers are installed the dhcp pool/relay info will be constructed when the interface gets reported as up by netifd. At the same time also register interface triggers based on DHCP relay config. Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> (cherry picked from commit 2336b942b37f265c59547d738ca558b61102833d)
-rw-r--r--package/network/services/dnsmasq/Makefile2
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init19
2 files changed, 15 insertions, 6 deletions
diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 0a8ae5d..703fedf 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.80test2
-PKG_RELEASE:=4
+PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/test-releases
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index bb8d07f..c1ae093 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -844,8 +844,10 @@ dnsmasq_start()
config_list_foreach "$cfg" "rev_server" append_rev_server
config_list_foreach "$cfg" "address" append_address
config_list_foreach "$cfg" "ipset" append_ipset
- config_list_foreach "$cfg" "interface" append_interface
- config_list_foreach "$cfg" "notinterface" append_notinterface
+ [ -n "$BOOT" ] || {
+ config_list_foreach "$cfg" "interface" append_interface
+ config_list_foreach "$cfg" "notinterface" append_notinterface
+ }
config_list_foreach "$cfg" "addnhosts" append_addnhosts
config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain
append_parm "$cfg" "leasefile" "--dhcp-leasefile" "/tmp/dhcp.leases"
@@ -967,7 +969,7 @@ dnsmasq_start()
config_foreach filter_dnsmasq match dhcp_match_add "$cfg"
config_foreach filter_dnsmasq domain dhcp_domain_add "$cfg"
config_foreach filter_dnsmasq hostrecord dhcp_hostrecord_add "$cfg"
- config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg"
+ [ -n "$BOOT" ] || config_foreach filter_dnsmasq relay dhcp_relay_add "$cfg"
echo >> $CONFIGFILE_TMP
config_foreach filter_dnsmasq srvhost dhcp_srv_add "$cfg"
@@ -984,13 +986,13 @@ dnsmasq_start()
# Enable RA feature for when/if it is constructed,
# and RA is selected per interface pool (RA, DHCP, or both),
# but no one (should) want RA broadcast in syslog
- config_foreach filter_dnsmasq dhcp dhcp_add "$cfg"
+ [ -n "$BOOT" ] || config_foreach filter_dnsmasq dhcp dhcp_add "$cfg"
xappend "--enable-ra"
xappend "--quiet-ra"
append_bool "$cfg" quietdhcp "--quiet-dhcp6"
elif [ "$DNSMASQ_DHCP_VER" -gt 0 ] ; then
- config_foreach filter_dnsmasq dhcp dhcp_add "$cfg"
+ [ -n "$BOOT" ] || config_foreach filter_dnsmasq dhcp dhcp_add "$cfg"
fi
@@ -1059,6 +1061,13 @@ service_triggers()
config_load dhcp
config_foreach add_interface_trigger dhcp
+ config_foreach add_interface_trigger relay
+}
+
+boot()
+{
+ BOOT=1
+ start "$@"
}
start_service() {