aboutsummaryrefslogtreecommitdiffstats
path: root/package
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2022-12-16 11:37:30 +0100
committerFelix Fietkau <nbd@nbd.name>2022-12-16 14:32:47 +0100
commit133a1e2f3787ec995561398bda7571180598454f (patch)
treeee89446c51d10f584ff1ef6899c087869f99b889 /package
parent92acd9f3e8312883c3cbc7b3885c969d72c36f77 (diff)
downloadupstream-133a1e2f3787ec995561398bda7571180598454f.tar.gz
upstream-133a1e2f3787ec995561398bda7571180598454f.tar.bz2
upstream-133a1e2f3787ec995561398bda7571180598454f.zip
mac80211: work around a race condition on detecting a phy while bringing it up
When reloading modules and running wifi, a phy can sometimes be renamed while in the middle of a hotplug call that tries to detect new phys This can lead to bogus wifi-device sections being created Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'package')
-rw-r--r--package/kernel/mac80211/files/lib/wifi/mac80211.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
index 3ecd932228..e24a2a634e 100644
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
@@ -167,6 +167,10 @@ detect_mac80211() {
path="$(iwinfo nl80211 path "$dev")"
macaddr="$(cat /sys/class/ieee80211/${dev}/macaddress)"
+
+ # work around phy rename related race condition
+ [ -n "$path" -o -n "$macaddr" ] || continue
+
board_dev=
fallback_board_dev=
json_for_each_item check_board_phy wlan