aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2019-12-05 18:35:36 +0100
committerDaniel Golle <daniel@makrotopia.org>2019-12-08 19:52:39 +0100
commit24b97579d20b6ac6df81654a953386d2912fc324 (patch)
tree005361411214975f9a4952be8556202bd2804596 /package/kernel
parent2568db3fff7be1be848d490a7f53af42ec14b257 (diff)
downloadupstream-24b97579d20b6ac6df81654a953386d2912fc324.tar.gz
upstream-24b97579d20b6ac6df81654a953386d2912fc324.tar.bz2
upstream-24b97579d20b6ac6df81654a953386d2912fc324.zip
hostapd: re-introduce process tracking
Before commit 60fb4c92b6 ("hostapd: add ubus reload") netifd was tracking hostapd/wpa_supplicant and restarting wifi in case of a process crash. Restore this behaviour by tracking the PIDs of hostapd and wpa_supplicant. Also make sure hostapd and/or wpa_supplicant have been started before emmitting ubus calls to them using ubus wait_for. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/kernel')
-rw-r--r--package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh3
1 files changed, 3 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 dd2b09c4a0..06244bf0e3 100644
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
@@ -940,7 +940,10 @@ drv_mac80211_setup() {
}
else
add_ap=1
+ ubus wait_for hostapd.$phy
ubus call hostapd.${phy} config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}"
+ local hostapd_pid=$(ubus call service list '{"name": "hostapd"}' | jsonfilter -l 1 -e "@['hostapd'].instances['hostapd-${phy}'].pid")
+ wireless_add_process "$hostapd_pid" "/usr/sbin/hostapd" 1
fi
ret="$?"
[ "$ret" != 0 ] && {