diff options
Diffstat (limited to 'modules/luci-base/luasrc')
-rw-r--r-- | modules/luci-base/luasrc/model/cbi/admin_network/proto_static.lua | 2 | ||||
-rw-r--r-- | modules/luci-base/luasrc/model/network.lua | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/model/cbi/admin_network/proto_static.lua b/modules/luci-base/luasrc/model/cbi/admin_network/proto_static.lua index 3f8b091cf3..ac8b7bf654 100644 --- a/modules/luci-base/luasrc/model/cbi/admin_network/proto_static.lua +++ b/modules/luci-base/luasrc/model/cbi/admin_network/proto_static.lua @@ -60,7 +60,7 @@ if luci.model.network:has_ipv6() then local ip6prefix = s:taboption("general", Value, "ip6prefix", translate("IPv6 routed prefix"), translate("Public prefix routed to this device for distribution to clients.")) - ip6prefix.datatype = "ip6addr" + ip6prefix.datatype = "list(ip6addr)" ip6prefix:depends("ip6assign", "") local ip6ifaceid = s:taboption("general", Value, "ip6ifaceid", translate("IPv6 suffix"), diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 49e1657aae..5910a78560 100644 --- a/modules/luci-base/luasrc/model/network.lua +++ b/modules/luci-base/luasrc/model/network.lua @@ -1119,6 +1119,14 @@ function protocol.ip6prefix(self) end end +function protocol.ip6prefixes(self) + local prefixes = { } + for _, prefix in ipairs(self:_ubus("ipv6-prefix") or { }) do + prefixes[#prefixes+1] = "%s/%d" %{ prefix.address, prefix.mask } + end + return prefixes +end + function protocol.errors(self) local _, err, rv local errors = self:_ubus("errors") |