libs/core: fallback to ipv6-prefix-assignment if ipv6-address is empty
This commit is contained in:
parent
ead51693dc
commit
f804a21c8d
1 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue