diff options
author | Daniel Golle <daniel@makrotopia.org> | 2020-12-07 13:12:46 +0000 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2021-01-10 19:15:51 +0000 |
commit | 2d305ff13a5e24fd2bd54e7dcde89539950974a1 (patch) | |
tree | fa0e674e2893a273b3f23d45e2e5d7265f00e9a2 /package/network/services/hostapd/files/hostapd.sh | |
parent | 425e392466f139a3ed349d65b2d556b4dd56304e (diff) | |
download | upstream-2d305ff13a5e24fd2bd54e7dcde89539950974a1.tar.gz upstream-2d305ff13a5e24fd2bd54e7dcde89539950974a1.tar.bz2 upstream-2d305ff13a5e24fd2bd54e7dcde89539950974a1.zip |
hostapd: return PID on config_add call
To simplify the way netifd acquires the PIDs of wpa_supplicant and
hostapd let the config_add method of both of them return the PID of the
called process. Use the returned PID instead of querying procd when
adding wpa_supplicant configuration.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'package/network/services/hostapd/files/hostapd.sh')
-rw-r--r-- | package/network/services/hostapd/files/hostapd.sh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 0f6741336b..7d9ee5121e 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -1379,18 +1379,17 @@ wpa_supplicant_run() { _wpa_supplicant_common "$ifname" ubus wait_for wpa_supplicant - ubus call wpa_supplicant config_add "{ \ + local supplicant_pid=$(ubus call wpa_supplicant config_add "{ \ \"driver\": \"${_w_driver:-wext}\", \"ctrl\": \"$_rpath\", \ \"iface\": \"$ifname\", \"config\": \"$_config\" \ ${network_bridge:+, \"bridge\": \"$network_bridge\"} \ ${hostapd_ctrl:+, \"hostapd_ctrl\": \"$hostapd_ctrl\"} \ - }" + }" | jsonfilter -l 1 -e @.pid) ret="$?" [ "$ret" != 0 ] && wireless_setup_vif_failed WPA_SUPPLICANT_FAILED - local supplicant_pid=$(ubus call service list '{"name": "wpad"}' | jsonfilter -l 1 -e "@['wpad'].instances['supplicant'].pid") wireless_add_process "$supplicant_pid" "/usr/sbin/wpa_supplicant" 1 1 return $ret |