From aa76c06b6a7fc4a5f8767cd0a99b208f4aa576fc Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Fri, 20 Jan 2023 19:39:54 -0800 Subject: [PATCH] Ignore non-routable when calculating hidden nodes (#665) * Exclude neighbor's neighbors which are non-routable. If a neighbor node's neighbor is non-routable, then no traffic will flow from it, so it's not hidden * Use routable flag for exposed node detection --- files/usr/local/bin/mgr/lqm.lua | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/files/usr/local/bin/mgr/lqm.lua b/files/usr/local/bin/mgr/lqm.lua index cd43c60b..40fdee39 100755 --- a/files/usr/local/bin/mgr/lqm.lua +++ b/files/usr/local/bin/mgr/lqm.lua @@ -525,11 +525,13 @@ function lqm() if tonumber(rtrack.lat) and tonumber(rtrack.lon) and lat and lon then rdistance = calc_distance(lat, lon, tonumber(rtrack.lat), tonumber(rtrack.lon)) end - rflinks[track.mac][rtrack.ip] = { - ip = rtrack.ip, - hostname = rhostname, - distance = rdistance - } + if rtrack.routable then + rflinks[track.mac][rtrack.ip] = { + ip = rtrack.ip, + hostname = rhostname, + distance = rdistance + } + end end if myhostname == rhostname then if not old_rev_snr or not rtrack.snr then @@ -538,7 +540,7 @@ function lqm() track.rev_snr = math.ceil(snr_run_avg * old_rev_snr + (1 - snr_run_avg) * rtrack.snr) end end - if not rtrack.blocked and not tracker[rtrack.mac] and not our_macs[rtrack.mac] and rfcount > 1 then + if rtrack.routable and not tracker[rtrack.mac] and not our_macs[rtrack.mac] and rfcount > 1 then track.exposed = true end end