From 354508752cfb93976784ac6740c6a525e27d99f1 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 28 Jul 2014 16:29:20 +0200 Subject: [PATCH] gluon-mesh-batman-adv: fix network.mesh_inferfaces announce field with new netifd --- .../announce/nodeinfo.d/network/mesh_interfaces | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces b/package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces index d078fcb1..1fef5e10 100644 --- a/package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces +++ b/package/gluon-mesh-batman-adv/files/lib/gluon/announce/nodeinfo.d/network/mesh_interfaces @@ -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