From c949d0e6c6c24e2bbef58f519816a4d45502f73e Mon Sep 17 00:00:00 2001 From: Shine <4c.fce2@proton.me> Date: Wed, 18 Mar 2026 21:08:38 +0100 Subject: [PATCH] wifi-scripts: fix hostapd config for 160MHz After 02e2065203c5e6c95f88e3501644d3e6ad740f89, it can happen that both, [VHT160-80PLUS80] and [VHT160] are added to the vht_capab option in an AP's hostapd.conf, which would cause a failure to start the AP. Fix the logic in order to prevent such misconfiguration. Fixes: #22481 Signed-off-by: Shine <4c.fce2@proton.me> Link: https://github.com/openwrt/openwrt/pull/22482 Signed-off-by: Robert Marko --- .../wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc index 49262c9d61..6e6b8bb2eb 100644 --- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc +++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/hostapd.uc @@ -354,10 +354,10 @@ function device_htmode_append(config) { config.vht_capab += '[BF-ANTENNA-' + min(((vht_capab >> 13) & 3) + 1, config.beamformer_antennas) + ']'; /* supported Channel widths */ - if (((vht_capab & 0xc) == 4 || (vht_capab & 0xc) == 8) && config.vht160 >= 1) - config.vht_capab += '[VHT160]'; if ((vht_capab & 0xc) == 8 && config.vht160 >= 2) config.vht_capab += '[VHT160-80PLUS80]'; + else if (((vht_capab & 0xc) == 4 || (vht_capab & 0xc) == 8) && config.vht160 >= 1) + config.vht_capab += '[VHT160]'; /* maximum MPDU length */ if ((vht_capab & 3) > 1 && config.vht_max_mpdu >= 11454)