summaryrefslogtreecommitdiffhomepage
path: root/modules/admin-full
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-11-18 12:29:01 +0000
committerSteven Barth <steven@midlink.org>2008-11-18 12:29:01 +0000
commit9d6096a5f4810430b976dc9cc7d24581e2085d25 (patch)
tree69f697a0165db7e3a0bb90ec1ddecdec81ca9afa /modules/admin-full
parent47c601d7a16567202786b9cce98c15f60fbd82bb (diff)
Fix behaviour of dynamicdhcp field (thanks to Fabio Mercuri)
Diffstat (limited to 'modules/admin-full')
-rw-r--r--modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua b/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua
index 17dcdb8f00..872e6444d1 100644
--- a/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua
+++ b/modules/admin-full/luasrc/model/cbi/admin_network/dhcp.lua
@@ -45,7 +45,11 @@ s:option(Value, "limit", translate("limit")).rmempty = true
s:option(Value, "leasetime").rmempty = true
-s:option(Flag, "dynamicdhcp").rmempty = true
+local dd = s:option(Flag, "dynamicdhcp")
+dd.rmempty = false
+function dd.cfgvalue(self, section)
+ return Flag.cfgvalue(self, section) or "1"
+end
s:option(Value, "name", translate("name")).optional = true
@@ -65,4 +69,4 @@ for i, n in ipairs(s.children) do
end
end
-return m \ No newline at end of file
+return m