projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c4cf926
)
libs/core: fallback to ipv6-prefix-assignment if ipv6-address is empty
author
Steven Barth
<steven@midlink.org>
Mon, 24 Jun 2013 12:00:33 +0000
(12:00 +0000)
committer
Steven Barth
<steven@midlink.org>
Mon, 24 Jun 2013 12:00:33 +0000
(12:00 +0000)
libs/core/luasrc/model/network.lua
patch
|
blob
|
history
diff --git
a/libs/core/luasrc/model/network.lua
b/libs/core/luasrc/model/network.lua
index 09a58d74249bb5f6dba1ea791dccfc2f9d6b57a3..ecfaa84dc1707dc1f95c74d554524738ab40e539 100644
(file)
--- a/
libs/core/luasrc/model/network.lua
+++ b/
libs/core/luasrc/model/network.lua
@@
-813,8
+813,14
@@
end
function protocol.ip6addr(self)
local addrs = self:_ubus("ipv6-address")
- return addrs and #addrs > 0
- and "%s/%d" %{ addrs[1].address, addrs[1].mask }
+ if addrs and #addrs > 0 then
+ return "%s/%d" %{ addrs[1].address, addrs[1].mask }
+ else
+ addrs = self:_ubus("ipv6-prefix-assignment")
+ if addrs and #addrs > 0 then
+ return "%s/%d" %{ addrs[1].address, addrs[1].mask }
+ end
+ end
end
function protocol.gw6addr(self)