From 2d305ff13a5e24fd2bd54e7dcde89539950974a1 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 7 Dec 2020 13:12:46 +0000 Subject: 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 --- package/network/services/hostapd/src/src/ap/ubus.c | 4 ++++ package/network/services/hostapd/src/wpa_supplicant/ubus.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'package/network/services/hostapd/src') diff --git a/package/network/services/hostapd/src/src/ap/ubus.c b/package/network/services/hostapd/src/src/ap/ubus.c index 8546d2ce69..d03b848f94 100644 --- a/package/network/services/hostapd/src/src/ap/ubus.c +++ b/package/network/services/hostapd/src/src/ap/ubus.c @@ -658,6 +658,10 @@ hostapd_config_add(struct ubus_context *ctx, struct ubus_object *obj, if (hostapd_add_iface(interfaces, buf)) return UBUS_STATUS_INVALID_ARGUMENT; + blob_buf_init(&b, 0); + blobmsg_add_u32(&b, "pid", getpid()); + ubus_send_reply(ctx, req, b.head); + return UBUS_STATUS_OK; } diff --git a/package/network/services/hostapd/src/wpa_supplicant/ubus.c b/package/network/services/hostapd/src/wpa_supplicant/ubus.c index 4bb92a7b66..16a68c5073 100644 --- a/package/network/services/hostapd/src/wpa_supplicant/ubus.c +++ b/package/network/services/hostapd/src/wpa_supplicant/ubus.c @@ -264,6 +264,10 @@ wpas_config_add(struct ubus_context *ctx, struct ubus_object *obj, if (!wpa_supplicant_add_iface(global, iface, NULL)) return UBUS_STATUS_INVALID_ARGUMENT; + blob_buf_init(&b, 0); + blobmsg_add_u32(&b, "pid", getpid()); + ubus_send_reply(ctx, req, b.head); + return UBUS_STATUS_OK; } -- cgit v1.2.3