From f8d71b65522cefbd2a1af258455c84e24578c9cb Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Wed, 22 Jun 2022 10:48:45 -0700 Subject: [PATCH] Never block short DtD links regardless of quality. Ignore invalid mac from arp table when building lookup table. This avoids a problem where a mac can be in the table twice, once valid and once invalid with an old ip address. --- files/usr/local/bin/mgr/lqm.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/files/usr/local/bin/mgr/lqm.lua b/files/usr/local/bin/mgr/lqm.lua index 9c9e0c70..ccb61e53 100755 --- a/files/usr/local/bin/mgr/lqm.lua +++ b/files/usr/local/bin/mgr/lqm.lua @@ -222,7 +222,9 @@ function lqm() local arps = {} arptable( function (entry) - arps[entry["HW address"]:upper()] = entry + if entry["Flags"] ~= "0x0" then + arps[entry["HW address"]:upper()] = entry + end end ) @@ -303,7 +305,7 @@ function lqm() -- DtD for mac, entry in pairs(arps) do - if entry.Device:match("%.2$") and entry["Flags"] ~= "0x0" then + if entry.Device:match("%.2$") then stations[#stations + 1] = { type = "DtD", device = entry.Device, @@ -632,7 +634,7 @@ function lqm() -- Block if quality is poor if track.quality then - if not track.blocks.quality and track.quality < config.min_quality then + if not track.blocks.quality and track.quality < config.min_quality and (track.type ~= "DtD" or (track.distance and track.distance >= dtd_distance)) then track.blocks.quality = true elseif track.blocks.quality and track.quality >= config.min_quality + config.margin_quality then track.blocks.quality = false