aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorBob Cantor <coxede6557@w3boats.com>2021-06-25 04:07:34 +1000
committerFelix Fietkau <nbd@nbd.name>2021-06-28 17:24:11 +0200
commitd515f6b6cde357bf480d32a7387f07ea40e85e52 (patch)
treea2b2c1850d4a5e5aef7ea48f55648c840e4c21f0 /package
parenta29ab3b79affb62fda82e0825ed811eaf482dd3c (diff)
downloadupstream-d515f6b6cde357bf480d32a7387f07ea40e85e52.tar.gz
upstream-d515f6b6cde357bf480d32a7387f07ea40e85e52.tar.bz2
upstream-d515f6b6cde357bf480d32a7387f07ea40e85e52.zip
mac80211: always call wireless_set_data (FS#3784)
When wifi is turned off, drv_mac80211_teardown sometimes fails (silently) because the device to be torn down is not defined. This situation arises if drv_mac80211_setup was called twice when wifi was turned on. This commit ensures that the device to be torn down is always defined in drv_mac80211_teardown. Steps to reproduce: 1) Use /sbin/wifi to turn on wifi. uci set wireless.@wifi-iface[0].disabled=0 uci set wireless.@wifi-device[0].disabled=0 uci commit wifi 2) Use /sbin/wifi to turn off wifi. uci set wireless.@wifi-device[0].disabled=1 uci commit wifi 3) Observe that wifi is still up. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor <coxede6557@w3boats.com>
Diffstat (limited to 'package')
-rw-r--r--package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
index c7437d5a96..ffb3662d04 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -1021,10 +1021,8 @@ drv_mac80211_setup() {
return 1
}
- [ -z "$(uci -q -P /var/state show wireless._${phy})" ] && {
- uci -q -P /var/state set wireless._${phy}=phy
- wireless_set_data phy="$phy"
- }
+ wireless_set_data phy="$phy"
+ [ -z "$(uci -q -P /var/state show wireless._${phy})" ] && uci -q -P /var/state set wireless._${phy}=phy
OLDAPLIST=$(uci -q -P /var/state get wireless._${phy}.aplist)
OLDSPLIST=$(uci -q -P /var/state get wireless._${phy}.splist)