[OpenWrt-Devel] [PATCH 2/2] dnsmasq: Add enable parameter in the UCI DHCP host section

Hans Dedecker dedeckeh at gmail.com
Thu Mar 31 06:18:30 EDT 2016


Parameter allows to enable/disable static leases; by default the value is 1
to keep backwards compatibility

Signed-off-by: Hans Dedecker <dedeckeh at gmail.com>
---
 package/network/services/dnsmasq/files/dnsmasq.init | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 2d36fc6..aad1ab9 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -316,6 +316,9 @@ dhcp_host_add() {
 	config_get networkid "$cfg" networkid
 	[ -n "$networkid" ] && dhcp_option_add "$cfg" "$networkid" "$force"
 
+	config_get_bool enable "$cfg" enable 1
+	[ "$enable" = "0" ] && return 0
+
 	config_get name "$cfg" name
 	config_get ip "$cfg" ip
 	[ -n "$ip" -o -n "$name" ] || return 0
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list