luci-olsr: fix ipv6 nil in device var

This commit is contained in:
Patrick Grimm 2013-08-11 21:07:25 +00:00
parent 3b0dee6e5c
commit f496c67d25

View file

@ -199,6 +199,7 @@ function action_neigh(json)
local net = ntm:get_network(name) local net = ntm:get_network(name)
local device = net and net:get_interface() local device = net and net:get_interface()
local locip = ipc.IPv6(v.localIP) local locip = ipc.IPv6(v.localIP)
if device and device:ip6addrs() and locip then
for _, a in ipairs(device:ip6addrs()) do for _, a in ipairs(device:ip6addrs()) do
if not a:is6linklocal() then if not a:is6linklocal() then
if a:host() == locip:host() then if a:host() == locip:host() then
@ -207,6 +208,7 @@ function action_neigh(json)
end end
end end
end end
end
end) end)
for ip,mac in pairs(neihgt) do for ip,mac in pairs(neihgt) do
if ip == v.remoteIP then if ip == v.remoteIP then