gluon-mesh-batman-adv: fix network.mesh_inferfaces announce field with new netifd

This commit is contained in:
Matthias Schiffer 2014-07-28 16:29:20 +02:00
parent 6296d7631d
commit 167e7d5a1c
1 changed files with 8 additions and 8 deletions

View File

@ -1,15 +1,15 @@
require 'ubus'
local conn = ubus.connect()
local list = util.exec('batctl if')
local interfaces = {}
for _, line in ipairs(util.split(list)) do
local ifname = line:match('^(.-):')
if ifname ~= nil then
local status = conn:call("network.device", "status", { name = ifname })
table.insert(interfaces, status['macaddr'])
end
local ifname = line:match('^(.-):')
if ifname ~= nil then
pcall(
function()
table.insert(interfaces, util.trim(fs.readfile('/sys/class/net/' .. ifname .. '/address')))
end
)
end
end
return interfaces