diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-02-16 17:04:13 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-02-16 17:05:52 +0100 |
commit | 461df8b0dc1a9be5fb9e904d8cdc44c6d0cbd6c8 (patch) | |
tree | 24470468fa752bb5e7d809f02abc0aa1f56a61e8 /modules/luci-base/luasrc | |
parent | de4f1c9046cba0f2dc6d33e92d68d787eed00aa5 (diff) |
luci-base: do not assume a fixed host address in delegated prefix (#1484)
OpenWrt/LEDE introduced the "local-address" field a while back to expose the
effective local host address of the delegated prefix, so use that information
instead of assuming `[prefix]:1`.
Fixes #1484.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/luasrc')
-rw-r--r-- | modules/luci-base/luasrc/model/network.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/model/network.lua b/modules/luci-base/luasrc/model/network.lua index 6f405a131..9ea8e369d 100644 --- a/modules/luci-base/luasrc/model/network.lua +++ b/modules/luci-base/luasrc/model/network.lua @@ -998,7 +998,12 @@ function protocol.ip6addrs(self) if type(addrs) == "table" then for n, addr in ipairs(addrs) do - rv[#rv+1] = "%s1/%d" %{ addr.address, addr.mask } + if type(addr["local-address"]) == "table" then + rv[#rv+1] = "%s/%d" %{ + addr["local-address"].address, + addr["local-address"].mask + } + end end end |