From 66496e151813d3a9ff4eaf9b00ed50fc4a6f2472 Mon Sep 17 00:00:00 2001 From: Yaro Kasear Date: Fri, 2 May 2025 11:22:00 -0500 Subject: [PATCH] Optimize AP-client matching loop --- listener.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/listener.py b/listener.py index 32bc26a..99ab8a4 100755 --- a/listener.py +++ b/listener.py @@ -140,12 +140,10 @@ def handle_packet(pkt): ap_clients[da][sa] += 5 # Track clients talking to any known AP - if a1 and a2: - for bssid in aps: - if bssid in (a1, a2): - peer = a2 if bssid == a1 else a1 - if is_unicast(peer): - ap_clients[bssid][peer] += 1 + if a1 in aps and is_unicast(a2): + ap_clients[a1][a2] += 1 + elif a2 in aps and is_unicast(a1): + ap_clients[a2][a1] += 1 # === Signal strength tracking === try: