Fix 5GHz WiFi scanning failures in deep scan and band detection

- Fix deep scan with 'All bands' never scanning 5GHz: band='all' now
  correctly passes --band abg to airodump-ng (previously no flag was
  added, causing airodump-ng to default to 2.4GHz-only)
- Fix APs first seen without channel info permanently stuck at
  band='unknown': _update_access_point now backfills channel, frequency,
  and band when a subsequent observation resolves the channel
- Fix legacy /wifi/scan/start combining mutually exclusive --band and -c
  flags: --band is now only added when no explicit channel list is given,
  and the interface is always placed as the last argument

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-03-20 21:50:47 +00:00
parent b20b9838d0
commit 89c7c2fb07
2 changed files with 151 additions and 137 deletions

View File

@@ -673,13 +673,6 @@ def start_wifi_scan():
os.remove(f)
airodump_path = get_tool_path('airodump-ng')
cmd = [
airodump_path,
'-w', csv_path,
'--output-format', 'csv,pcap',
'--band', band,
interface
]
channel_list = None
if channels:
@@ -688,10 +681,22 @@ def start_wifi_scan():
except ValueError as e:
return api_error(str(e), 400)
cmd = [
airodump_path,
'-w', csv_path,
'--output-format', 'csv,pcap',
]
# --band and -c are mutually exclusive: only add --band when not
# locking to specific channels, and always place the interface last.
if channel_list:
cmd.extend(['-c', ','.join(str(c) for c in channel_list)])
elif channel:
cmd.extend(['-c', str(channel)])
else:
cmd.extend(['--band', band])
cmd.append(interface)
logger.info(f"Running: {' '.join(cmd)}")