diff --git a/hoodselector/luasrc/usr/sbin/hoodselector b/hoodselector/luasrc/usr/sbin/hoodselector index 5b135af9999070396fe14a86f2fa26dd01f41f2e..7691163113f82c701e740743143f432b2501d390 100755 --- a/hoodselector/luasrc/usr/sbin/hoodselector +++ b/hoodselector/luasrc/usr/sbin/hoodselector @@ -929,16 +929,16 @@ local function molw_get_bssid(iface) -- differentiate between VPN and mesh only routers local vpn_router_neigbour_bssids = {} local mesh_router_neigbour_bssids = {} + local own_mac = uci:get('network', 'client', 'macaddr') for _,respondd_if in ipairs(iface) do local respondd = string.format("gluon-neighbour-info -i " .. respondd_if .. " -p 1001 -d ff02::2 -r hoodselector -t 0.5") print(respondd) - local drop_first = false -- first one is node it selfe! for line in io.popen(respondd, 'r'):lines() do local obj, _, err = json.parse (line, 1, nil) if err then io.stdout:write("json parse error!\n") else - if drop_first then + if obj["mac"] ~= own_mac then if obj["hoodinfo"] ~= nil then if obj["hoodinfo"]["vpnrouter"]:match("true") then if obj["selectedbssid"] ~= nil then @@ -963,7 +963,6 @@ local function molw_get_bssid(iface) end end end - drop_first = true end end end diff --git a/hoodselector/src/respondd.c b/hoodselector/src/respondd.c index eb975fe9fcdfa0c5c1125254bd408b0c341950f4..4e54cb411d0b05047abbedfd990d16807cba2671 100644 --- a/hoodselector/src/respondd.c +++ b/hoodselector/src/respondd.c @@ -165,6 +165,8 @@ static struct json_object * respondd_provider_hoodselector(void) { if(mesh_on_lan_wan) json_object_object_add(ret, "mesh", mesh_on_lan_wan); + json_object_object_add(ret, "mac", gluonutil_wrap_and_free_string(gluonutil_get_sysconfig("primary_mac"))); + return ret; }