summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2012-04-15 14:31:12 +0000
committerJo-Philipp Wich <jow@openwrt.org>2012-04-15 14:31:12 +0000
commit4f9363d70091bfb1883b1f6ab913554c02cbbad2 (patch)
tree0c8566f15bcce78ece411cddfdab8e32ec1bc113 /applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua
parentfd28386e35a947cf9966ae6fd8d2dd5673279bad (diff)
applications/luci-radvd: allow the special value "infinity" for preferred lifetime options, resync translation
Diffstat (limited to 'applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua')
-rw-r--r--applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua42
1 files changed, 4 insertions, 38 deletions
diff --git a/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua b/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua
index 6151910649..6032986510 100644
--- a/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua
+++ b/applications/luci-radvd/luasrc/model/cbi/radvd/prefix.lua
@@ -115,52 +115,18 @@ o = s:taboption("advanced", Flag, "AdvRouterAddr", translate("Advertise router a
o = s:taboption("advanced", Value, "AdvValidLifetime", translate("Valid lifetime"),
- translate("Advertises the length of time in seconds that the prefix is valid for the purpose of on-link determination. Use 0 to specify an infinite lifetime"))
+ translate("Advertises the length of time in seconds that the prefix is valid for the purpose of on-link determination."))
-o.datatype = "uinteger"
+o.datatype = 'or(uinteger,"infinity")'
o.placeholder = 86400
-function o.cfgvalue(self, section)
- local v = Value.cfgvalue(self, section)
- if v == "infinity" then
- return 0
- else
- return v
- end
-end
-
-function o.write(self, section, value)
- if value == "0" then
- Value.write(self, section, "infinity")
- else
- Value.write(self, section, value)
- end
-end
-
o = s:taboption("advanced", Value, "AdvPreferredLifetime", translate("Preferred lifetime"),
- translate("Advertises the length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred. Use 0 to specify an infinite lifetime"))
+ translate("Advertises the length of time in seconds that addresses generated from the prefix via stateless address autoconfiguration remain preferred."))
-o.datatype = "uinteger"
+o.datatype = 'or(uinteger,"infinity")'
o.placeholder = 14400
-function o.cfgvalue(self, section)
- local v = Value.cfgvalue(self, section)
- if v == "infinity" then
- return 0
- else
- return v
- end
-end
-
-function o.write(self, section, value)
- if value == "0" then
- Value.write(self, section, "infinity")
- else
- Value.write(self, section, value)
- end
-end
-
o = s:taboption("advanced", Value, "Base6to4Interface", translate("6to4 interface"),
translate("Specifies a logical interface name to derive a 6to4 prefix from. The interfaces public IPv4 address is combined with 2002::/3 and the value of the prefix option"))