diff options
author | Daniel Golle <daniel@makrotopia.org> | 2019-11-14 14:02:56 +0100 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2019-11-14 14:10:58 +0100 |
commit | 000b7687bc50be5b0f1161f4bf8ceb85c495c395 (patch) | |
tree | 84da1e302e1bb4720bbfc99629ec99258d1ea88a /package/kernel/mac80211 | |
parent | b496a2294c6e663a2dcbf08d714443e758d1269d (diff) | |
download | upstream-000b7687bc50be5b0f1161f4bf8ceb85c495c395.tar.gz upstream-000b7687bc50be5b0f1161f4bf8ceb85c495c395.tar.bz2 upstream-000b7687bc50be5b0f1161f4bf8ceb85c495c395.zip |
mac80211: restore mac80211_interface_cleanup()
Changes introduced for dynamic wifi reconfiguration left behind
unmanaged interface types. Restore parts of the old function to
also clean (unencrypted, non-DFS) mesh and ad-hoc interfaces.
Fixes: a5bc9787d4 ("mac80211: add support for dynamically
reconfiguring wifi")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/kernel/mac80211')
-rw-r--r-- | package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 5b174cded6..2b8b2d4677 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -814,6 +814,13 @@ mac80211_interface_cleanup() { mac80211_vap_cleanup hostapd "${primary_ap}" mac80211_vap_cleanup wpa_supplicant "$(uci -q -P /var/state get wireless._${phy}.splist)" + for wdev in $(list_phy_interfaces "$phy"); do + local wdev_phy="$(readlink /sys/class/net/${wdev}/phy80211)" + wdev_phy="$(basename "$wdev_phy")" + [ -n "$wdev_phy" -a "$wdev_phy" != "$phy" ] && continue + ip link set dev "$wdev" down 2>/dev/null + iw dev "$wdev" del + done } mac80211_set_noscan() { @@ -945,6 +952,15 @@ drv_mac80211_setup() { wireless_set_up } +list_phy_interfaces() { + local phy="$1" + if [ -d "/sys/class/ieee80211/${phy}/device/net" ]; then + ls "/sys/class/ieee80211/${phy}/device/net" 2>/dev/null; + else + ls "/sys/class/ieee80211/${phy}/device" 2>/dev/null | grep net: | sed -e 's,net:,,g' + fi +} + drv_mac80211_teardown() { wireless_process_kill_all |