diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2012-06-07 14:51:30 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2012-06-07 14:51:30 +0000 |
commit | 7c72d241faf37ae3fdfe3cb997ad75ef8d230a2c (patch) | |
tree | 2ef90cfe5a32fa6036991d14a15e92be0a109b25 /protocols/core/luasrc | |
parent | a71e4414875f5e6373887323f07f2d6c70bc1afa (diff) |
protocols/core: fix defaultroute setting for DHCP interfaces
Diffstat (limited to 'protocols/core/luasrc')
-rw-r--r-- | protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua | 18 |
1 files changed, 3 insertions, 15 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 244d7cbd15..391eb1e013 100644 --- a/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua +++ b/protocols/core/luasrc/model/cbi/admin_network/proto_dhcp.lua @@ -14,7 +14,7 @@ local map, section, net = ... local ifc = net:get_interface() local hostname, accept_ra, send_rs -local bcast, no_gw, peerdns, dns, metric, clientid, vendorclass +local bcast, defaultroute, peerdns, dns, metric, clientid, vendorclass hostname = section:taboption("general", Value, "hostname", @@ -43,23 +43,11 @@ bcast = section:taboption("advanced", Flag, "broadcast", bcast.default = bcast.disabled -no_gw = section:taboption("advanced", Flag, "gateway", +defaultroute = section:taboption("advanced", Flag, "gateway", translate("Use default gateway"), translate("If unchecked, no default route is configured")) -no_gw.default = no_gw.enabled - -function no_gw.cfgvalue(...) - return Flag.cfgvalue(...) == "0.0.0.0" and "0" or "1" -end - -function no_gw.write(self, section, value) - if value == "1" then - m:set(section, "gateway", nil) - else - m:set(section, "gateway", "0.0.0.0") - end -end +defaultroute.default = defaultroute.enabled peerdns = section:taboption("advanced", Flag, "peerdns", |