mac80211: use hostapd PID returned from config_add
[openwrt/openwrt.git] / package / kernel / mac80211 / files / lib / netifd / wireless / mac80211.sh
index 95b6c817ffc1e397a0992c4268b5a485f4638135..7eea198cd91501a99655aabece2a9982efeca930 100644 (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="$?"