diff options
Diffstat (limited to 'package/kernel/mac80211/files/lib/netifd/wireless')
-rw-r--r-- | package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 29dd4de400..02c195e1fa 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -394,11 +394,10 @@ mac80211_generate_mac() { find_phy() { [ -n "$phy" -a -d /sys/class/ieee80211/$phy ] && return 0 [ -n "$path" ] && { - for phy in /sys/devices/$path/ieee80211/phy*; do - [ -e "$phy" ] && { - phy="${phy##*/}" - return 0 - } + for phy in $(ls /sys/class/ieee80211 2>/dev/null); do + case "$(readlink -f /sys/class/ieee80211/$phy/device)" in + *$path) return 0;; + esac done } [ -n "$macaddr" ] && { |