diff mbox

[OpenWrt-Devel] wpa_supplicant: set regulatory domain the same way as hostapd

Message ID 20151223131256.c88e5b41b61994a574b25740@ubnt.com
State Changes Requested
Headers show

Commit Message

Dmitry Ivanov Dec. 23, 2015, 11:12 a.m. UTC
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>
---
 package/network/services/hostapd/files/netifd.sh | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Felix Fietkau Dec. 23, 2015, 11:21 a.m. UTC | #1
On 2015-12-23 12:12, Dmitry Ivanov wrote:
> 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>
> ---
>  package/network/services/hostapd/files/netifd.sh | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
> index 5541e4d..6aca7f7 100644
> --- a/package/network/services/hostapd/files/netifd.sh
> +++ b/package/network/services/hostapd/files/netifd.sh
> @@ -536,9 +536,15 @@ wpa_supplicant_prepare_interface() {
>  		_w_modestr="mode=1"
>  	}
>  
> +	local country_str=
> +	[ -n "$network_bridge" ] && {
> +		country_str="country=$country"
Looks like a copy&paste error to me, should be -n "$country"

- Felix
diff mbox

Patch

diff --git a/package/network/services/hostapd/files/netifd.sh b/package/network/services/hostapd/files/netifd.sh
index 5541e4d..6aca7f7 100644
--- a/package/network/services/hostapd/files/netifd.sh
+++ b/package/network/services/hostapd/files/netifd.sh
@@ -536,9 +536,15 @@  wpa_supplicant_prepare_interface() {
 		_w_modestr="mode=1"
 	}
 
+	local country_str=
+	[ -n "$network_bridge" ] && {
+		country_str="country=$country"
+	}
+
 	wpa_supplicant_teardown_interface "$ifname"
 	cat > "$_config" <<EOF
 $ap_scan
+$country_str
 EOF
 	return 0
 }