fix: reject mixed 2.4GHz and radio1 AP requests with clear error

This commit is contained in:
2026-08-18 07:23:25 -05:00
parent cd39833f4b
commit 4fa7f8f855
2 changed files with 17 additions and 2 deletions
@@ -1817,8 +1817,14 @@ def h_pineap_wifi_set_ap(ctx):
open_band = channel_band(openap.get('channel')) if openap.get('channel') is not None else None
use_radio1 = wpa_band in (BAND_5G, BAND_6G) or open_band in (BAND_5G, BAND_6G)
if use_radio1:
wpa_active = bool(wpa.get('enabled', True)) and wpa.get('channel') is not None
open_active = bool(openap.get('enabled', True)) and openap.get('channel') is not None
wpa_active = (wpa_band in (BAND_5G, BAND_6G) and bool(wpa.get('enabled', True))
and wpa.get('channel') is not None)
open_active = (open_band in (BAND_5G, BAND_6G) and bool(openap.get('enabled', True))
and openap.get('channel') is not None)
wpa_present = bool(wpa.get('ssid') or wpa.get('enabled') is not None)
open_present = bool(openap.get('ssid') or openap.get('enabled') is not None)
if (wpa_present and wpa_band == BAND_2G) or (open_present and open_band == BAND_2G):
return 400, {'error': 'cannot configure 2.4GHz and radio1 APs in one request'}
if not (wpa_active or open_active):
_remove_radio1_ap()
device_run(['wifi', 'reload'])