modules/admin-full: fix default state and handling of the defaultroute and peerdns...
authorJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Jan 2009 20:48:05 +0000 (20:48 +0000)
committerJo-Philipp Wich <jow@openwrt.org>
Wed, 7 Jan 2009 20:48:05 +0000 (20:48 +0000)
modules/admin-full/luasrc/model/cbi/admin_network/ifaces.lua

index 267c41c9d3c7e16425886c69707dff8aea4e5f65..0530b5d57a871308ac81539bfefc8ce9dadf7fba 100644 (file)
@@ -216,12 +216,20 @@ if has_pppd or has_3g then
        )
        defaultroute:depends("proto", "ppp")
        defaultroute:depends("proto", "3g")
+       defaultroute.rmempty = false
+       function defaultroute.cfgvalue(...)
+               return ( AbstractValue.cfgvalue(...) or '1' )
+       end
 
        peerdns = s:option(Flag, "peerdns",
         translate("network_interface_peerdns"),
         translate("network_interface_peerdns_desc")
        )
        peerdns:depends("proto", "ppp")
+       peerdns.rmempty = false
+       function peerdns.cfgvalue(...)
+               return ( AbstractValue.cfgvalue(...) or '1' )
+       end
 
        ipv6 = s:option(Flag, "ipv6", translate("network_interface_ipv6") )
        ipv6:depends("proto", "ppp")