]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
wifi-scripts: use country_code for iw reg set in setup_phy
authorFelix Fietkau <nbd@nbd.name>
Fri, 10 Jul 2026 12:53:29 +0000 (14:53 +0200)
committerFelix Fietkau <nbd@nbd.name>
Thu, 16 Jul 2026 09:50:22 +0000 (11:50 +0200)
validate() converts the country alias to country_code and deletes country
before setup_phy() runs, so the iw reg set branch tested a null
config.country and never ran, leaving wdev-only radios (adhoc/mesh/monitor)
on the world regdomain. Use config.country_code.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
package/network/config/wifi-scripts/files-ucode/lib/netifd/wireless/mac80211.sh

index 5d3a99c7fc54f7f93200bf40689068a3db21f9ed..a0aeed487ae74ceba697e8bd9c6653a6a3df25f9 100755 (executable)
@@ -70,9 +70,9 @@ function setup_phy(phy, config, data) {
        config.channel = +config.channel;
        config.frequency = get_channel_frequency(config.band, config.channel);
 
-       if (config.country) {
-               log(`Setting country code to ${config.country}`);
-               system(`iw reg set ${config.country}`);
+       if (config.country_code) {
+               log(`Setting country code to ${config.country_code}`);
+               system(`iw reg set ${config.country_code}`);
        }
 
        set_default(config, 'rxantenna', 0xffffffff);