diff options
author | Patrick Grimm <patrick@lunatiki.de> | 2013-08-11 21:07:25 +0000 |
---|---|---|
committer | Patrick Grimm <patrick@lunatiki.de> | 2013-08-11 21:07:25 +0000 |
commit | f496c67d25be1450b3c8bf1a9cac8a66b86cb55c (patch) | |
tree | d50a0ddedbb0a823f35fc43f196f942419c4bc99 /applications/luci-olsr/luasrc | |
parent | 3b0dee6e5cc344f3f1abef7c3036a7cb8f1238cb (diff) |
luci-olsr: fix ipv6 nil in device var
Diffstat (limited to 'applications/luci-olsr/luasrc')
-rw-r--r-- | applications/luci-olsr/luasrc/controller/olsr.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/applications/luci-olsr/luasrc/controller/olsr.lua b/applications/luci-olsr/luasrc/controller/olsr.lua index cf3743f46a..9661318dbd 100644 --- a/applications/luci-olsr/luasrc/controller/olsr.lua +++ b/applications/luci-olsr/luasrc/controller/olsr.lua @@ -199,11 +199,13 @@ function action_neigh(json) local net = ntm:get_network(name) local device = net and net:get_interface() local locip = ipc.IPv6(v.localIP) - for _, a in ipairs(device:ip6addrs()) do - if not a:is6linklocal() then - if a:host() == locip:host() then - interface = name - neihgt = neightbl.get(device.ifname) or {} + if device and device:ip6addrs() and locip then + for _, a in ipairs(device:ip6addrs()) do + if not a:is6linklocal() then + if a:host() == locip:host() then + interface = name + neihgt = neightbl.get(device.ifname) or {} + end end end end |