Improve channel frequency retrieval in get_clients_on_channel to ensure attributes exist before accessing

This commit is contained in:
Yaro Kasear 2025-04-14 10:21:48 -05:00
parent 7cdb89b203
commit 0113f9c617

View file

@ -122,7 +122,11 @@ def get_clients_on_channel(capture, ap_channel, ap_bssid):
radio = packet.radiotap
wlan = packet.wlan
packet_freq = int(getattr(radio, 'channel_freq', -1))
if not hasattr(radio, 'channel') or not hasattr(radio.channel, 'freq'):
continue
packet_freq = int(radio.channel.freq)
packet_channel = get_channel_from_freq(packet_freq)
if packet_channel != ap_channel: