mac80211: restrict the killing of wpa_supplicant processes to the right interface (#5991)

SVN-Revision: 19334
lede-17.01
Felix Fietkau 2010-01-25 22:11:21 +00:00
parent 6f0883ae22
commit 8d689fedac
1 changed files with 6 additions and 2 deletions

View File

@ -173,14 +173,18 @@ disable_mac80211() (
set_wifi_down "$device" set_wifi_down "$device"
# kill all running hostapd and wpa_supplicant processes that # kill all running hostapd and wpa_supplicant processes that
# are running on atheros/mac80211 vifs # are running on atheros/mac80211 vifs
for pid in `pidof hostapd wpa_supplicant`; do for pid in `pidof hostapd`; do
grep -E "($phy|wlan)" /proc/$pid/cmdline >/dev/null && \ grep -E "$phy" /proc/$pid/cmdline >/dev/null && \
kill $pid kill $pid
done done
include /lib/network include /lib/network
for wdev in $(ls /sys/class/ieee80211/${phy}/device/net 2>/dev/null); do for wdev in $(ls /sys/class/ieee80211/${phy}/device/net 2>/dev/null); do
[ -f "/var/run/$wdev.pid" ] && kill $(cat /var/run/$wdev.pid) >&/dev/null 2>&1 [ -f "/var/run/$wdev.pid" ] && kill $(cat /var/run/$wdev.pid) >&/dev/null 2>&1
for pid in `pidof wpa_supplicant`; do
grep "$wdev" /proc/$pid/cmdline >/dev/null && \
kill $pid
done
ifconfig "$wdev" down 2>/dev/null ifconfig "$wdev" down 2>/dev/null
unbridge "$dev" unbridge "$dev"
iw dev "$wdev" del iw dev "$wdev" del