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>
This commit is contained in:
Daniel Golle
2020-12-07 13:12:46 +00:00
parent 425e392466
commit 2d305ff13a
4 changed files with 11 additions and 4 deletions

View File

@@ -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;
}

View File

@@ -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;
}