Stop node's LQM neighbors including itself (#502)

This commit is contained in:
Tim Wilkinson 2022-09-09 06:50:39 -07:00 committed by GitHub
parent 6ba17b8e5a
commit 238d0fcd70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -34,6 +34,7 @@
local json = require("luci.jsonc")
local ip = require("luci.ip")
local sys = require("luci.sys")
local info = require("aredn.info")
local refresh_timeout = 15 * 60 -- refresh high cost data every 15 minutes
@ -229,6 +230,16 @@ function lqm()
end
)
-- Know our macs so we can exclude them
local our_macs = {}
for _, devname in ipairs(sys.net.devices())
do
local info = ip.link(devname)
if info and info.mac then
our_macs[tostring(info.mac)] = true
end
end
local stations = {}
-- RF
@ -322,7 +333,7 @@ function lqm()
for _, station in ipairs(stations)
do
if station.signal ~= 0 then
if station.signal ~= 0 and not our_macs[station.mac] then
if not tracker[station.mac] then
tracker[station.mac] = {
type = station.type,