applications/luci-radvd: use is6linklocal()
This commit is contained in:
parent
4eb853d2d2
commit
cc275d166e
1 changed files with 2 additions and 4 deletions
|
@ -144,9 +144,8 @@ function o.cfgvalue(self, section)
|
||||||
local ifc = nm:get_interface(net:ifname())
|
local ifc = nm:get_interface(net:ifname())
|
||||||
if ifc then
|
if ifc then
|
||||||
local adr
|
local adr
|
||||||
local lla = luci.ip.IPv6("fe80::/10")
|
|
||||||
for _, adr in ipairs(ifc:ip6addrs()) do
|
for _, adr in ipairs(ifc:ip6addrs()) do
|
||||||
if not lla:contains(adr) then
|
if not adr:is6linklocal() then
|
||||||
v = adr:string()
|
v = adr:string()
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
@ -295,9 +294,8 @@ function o.cfgvalue(self, section)
|
||||||
local ifc = nm:get_interface(net:ifname())
|
local ifc = nm:get_interface(net:ifname())
|
||||||
if ifc then
|
if ifc then
|
||||||
local adr
|
local adr
|
||||||
local lla = luci.ip.IPv6("fe80::/10")
|
|
||||||
for _, adr in ipairs(ifc:ip6addrs()) do
|
for _, adr in ipairs(ifc:ip6addrs()) do
|
||||||
if not lla:contains(adr) then
|
if not adr:is6linklocal() then
|
||||||
v = adr:network(128):string()
|
v = adr:network(128):string()
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue