diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-06-03 17:19:13 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-06-03 17:19:13 +0000 |
commit | 1fa82a793721a8cd1696e6053a0351188b706f31 (patch) | |
tree | 7d1e5c3cbbda1097cdabc5c16b00b21773769c05 /protocols/core/luasrc | |
parent | 84dc8244d7099eeded556dd054be13046c4eab14 (diff) |
protocols/core: fix peerdns option for dhcp proto
Diffstat (limited to 'protocols/core/luasrc')
-rw-r--r-- | protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua b/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua index aaac14ebb8..244d7cbd15 100644 --- a/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua +++ b/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua @@ -1,7 +1,7 @@ --[[ LuCI - Lua Configuration Interface -Copyright 2011 Jo-Philipp Wich <xm@subsignal.org> +Copyright 2011-2012 Jo-Philipp Wich <xm@subsignal.org> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ local map, section, net = ... local ifc = net:get_interface() local hostname, accept_ra, send_rs -local bcast, no_gw, no_dns, dns, metric, clientid, vendorclass +local bcast, no_gw, peerdns, dns, metric, clientid, vendorclass hostname = section:taboption("general", Value, "hostname", @@ -62,31 +62,17 @@ function no_gw.write(self, section, value) end -no_dns = section:taboption("advanced", Flag, "_no_dns", +peerdns = section:taboption("advanced", Flag, "peerdns", translate("Use DNS servers advertised by peer"), translate("If unchecked, the advertised DNS server addresses are ignored")) -no_dns.default = no_dns.enabled - -function no_dns.cfgvalue(self, section) - local addr - for addr in luci.util.imatch(m:get(section, "dns")) do - return self.disabled - end - return self.enabled -end - -function no_dns.remove(self, section) - return m:del(section, "dns") -end - -function no_dns.write() end +peerdns.default = peerdns.enabled dns = section:taboption("advanced", DynamicList, "dns", translate("Use custom DNS servers")) -dns:depends("_no_dns", "") +dns:depends("peerdns", "") dns.datatype = "ipaddr" dns.cast = "string" |