Search Linux Wireless

[PATCH] cfg80211: reg: setup correct alpha2 after intersection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Setup correct alfa2 in last request after intersection.
In other case after intersection we could not change/set
new country using eg. iw reg set

Failed scenario:
- insmod cfg80211.ko
- iw reg set FR
- modprobe ath10k_pci (US hint)
- intersection and country set as "98"
- no way to setup new country using iw reg set

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@xxxxxxxxx>
---
@Luis I am not sure this is the best way to fix it, please review.

 net/wireless/reg.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 82948c8..8fd82b2 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -271,6 +271,7 @@ static void reset_regdomains(bool full_reset,
 			     const struct ieee80211_regdomain *new_regdom)
 {
 	const struct ieee80211_regdomain *r;
+	struct regulatory_request *lr;
 
 	ASSERT_RTNL();
 
@@ -284,6 +285,12 @@ static void reset_regdomains(bool full_reset,
 	if (r == &world_regdom)
 		r = NULL;
 
+	lr = get_last_request();
+	if (lr && new_regdom) {
+		lr->alpha2[0] = new_regdom->alpha2[0];
+		lr->alpha2[1] = new_regdom->alpha2[1];
+	}
+
 	rcu_free_regdom(r);
 	rcu_free_regdom(cfg80211_world_regdom);
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux