wpa_supplicant: set regulatory domain the same way as hostapd
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 3 Jan 2016 20:56:57 +0000 (20:56 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Sun, 3 Jan 2016 20:56:57 +0000 (20:56 +0000)
In sta-only configuration, wpa_supplicant needs correct regulatory
domain because otherwise it may skip channel of its AP during scan.

Another alternative is to fix "iw reg set" in mac80211 netifd script.
Currently it fails if some phy has private regulatory domain which
matches configured one.

Signed-off-by: Dmitry Ivanov <dima@ubnt.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48099 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/network/services/hostapd/files/netifd.sh

index 5541e4d..8056080 100644 (file)
@@ -536,9 +536,15 @@ wpa_supplicant_prepare_interface() {
                _w_modestr="mode=1"
        }
 
+       local country_str=
+       [ -n "$country" ] && {
+               country_str="country=$country"
+       }
+
        wpa_supplicant_teardown_interface "$ifname"
        cat > "$_config" <<EOF
 $ap_scan
+$country_str
 EOF
        return 0
 }