Filter out non-routable ARP entries which confuse LQM

This commit is contained in:
Tim Wilkinson 2023-02-01 22:38:17 -08:00 committed by Joe AE6XE
parent e515ed7ec6
commit eefcc888dc
1 changed files with 16 additions and 12 deletions

View File

@ -362,18 +362,22 @@ function lqm()
for mac, entry in pairs(arps)
do
if entry.Device:match("%.2$") or entry.Device:match("^br%-dtdlink") then
stations[#stations + 1] = {
type = "DtD",
device = entry.Device,
signal = nil,
ip = entry["IP address"],
mac = mac:upper(),
tx_packets = 0,
tx_fail = 0,
tx_retries = 0,
tx_bitrate = 0,
rx_bitrate = 0
}
-- Sometimes we find arp entries are not routable. Filter them out early.
local rt = ip.route(entry["IP address"])
if rt and tostring(rt.gw) == entry["IP address"] then
stations[#stations + 1] = {
type = "DtD",
device = entry.Device,
signal = nil,
ip = entry["IP address"],
mac = mac:upper(),
tx_packets = 0,
tx_fail = 0,
tx_retries = 0,
tx_bitrate = 0,
rx_bitrate = 0
}
end
end
end