mac80211: use hostapd PID returned from config_add

Use PID returned from config_add instead of querying procd when adding
configuration to hostapd.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle
2020-12-07 13:46:43 +00:00
parent 2d305ff13a
commit cbd67dbdcd
2 changed files with 2 additions and 3 deletions

View File

@@ -1019,8 +1019,7 @@ drv_mac80211_setup() {
if [ "$no_reload" != "0" ]; then
add_ap=1
ubus wait_for hostapd
ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}"
local hostapd_pid=$(ubus call service list '{"name": "wpad"}' | jsonfilter -l 1 -e "@['wpad'].instances['hostapd'].pid")
local hostapd_pid=$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}" | jsonfilter -l 1 -e @.pid)
wireless_add_process "$hostapd_pid" "/usr/sbin/hostapd" 1 1
fi
ret="$?"