summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Maurer2026-04-14 23:05:45 +0000
committerDavid Bauer2026-05-07 19:15:44 +0000
commit530366cdfde5df5428c0bbd4ceb1e3c28f44d9c7 (patch)
tree3c26110486c0f35547b3f27ba2a02f8818a1f7a7
parent8190b4edad64f8caaaaa5a80b8e7b5cde38986e1 (diff)
downloadopenwrt-530366cdfde5df5428c0bbd4ceb1e3c28f44d9c7.tar.gz
wifi-scripts: fix basic_rate mapping in supplicant ucode
The ucode migration wrote "basic_rate" into the wpa_supplicant network block, but that is not a valid wpa_supplicant network field, causing: Line 15: unknown network field 'basic_rate'. failed to parse network block. Map UCI basic_rate to the correct wpa_supplicant fields, matching the behavior of the legacy shell script (hostapd.sh): - mesh mode: mesh_basic_rates (space-separated, 100 kb/s units) - sta/adhoc: rates (comma-separated Mbps) Link: https://github.com/openwrt/openwrt/commit/a854d833eabdbc3b42065927c136d75b981a1021 Signed-off-by: Florian Maurer <f.maurer@outlook.de> [fix commit message link] Signed-off-by: David Bauer <mail@david-bauer.net> (cherry picked from commit 8810ecd5ed25df203ca5f99146e24c039aabf288)
-rw-r--r--package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc18
1 files changed, 16 insertions, 2 deletions
diff --git a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc
index e6cdf8d578..2fad26dd97 100644
--- a/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc
+++ b/package/network/config/wifi-scripts/files-ucode/usr/share/ucode/wifi/supplicant.uc
@@ -172,7 +172,21 @@ function setup_sta(data, config) {
config.key_mgmt ??= 'NONE';
- config.basic_rate = ratelist(config.basic_rate);
+ /*
+ * Map UCI basic_rate to the correct wpa_supplicant network field:
+ * mesh -> mesh_basic_rates (space-separated, 100 kb/s units)
+ * other -> rates (comma-separated Mbps, e.g. "5.5,11")
+ * "basic_rate" itself is not a valid wpa_supplicant network field.
+ */
+ let brates = config.basic_rate;
+ config.basic_rate = null;
+ if (brates != null && length(brates) > 0) {
+ if (config.mode == 'mesh')
+ config.mesh_basic_rates = join(" ", map(brates, (br) => "" + int(br / 100)));
+ else
+ config.rates = ratelist(brates);
+ }
+
config.mcast_rate = ratestr(config.mcast_rate);
network_append_string_vars(config, [ 'ssid',
@@ -185,7 +199,7 @@ function setup_sta(data, config) {
'ocv', 'beacon_prot', 'key_mgmt', 'sae_pwe', 'psk', 'sae_password', 'pairwise', 'group', 'bssid',
'proto', 'mesh_fwding', 'mesh_rssi_threshold', 'frequency', 'fixed_freq',
'disable_ht', 'disable_ht40', 'disable_vht', 'vht', 'max_oper_chwidth',
- 'ht40', 'beacon_int', 'ieee80211w', 'basic_rate', 'mcast_rate',
+ 'ht40', 'beacon_int', 'ieee80211w', 'rates', 'mesh_basic_rates', 'mcast_rate',
'altsubject_match', 'domain_match', 'domain_suffix_match',
'bssid_blacklist', 'bssid_whitelist', 'erp',
]);