From dafdf98b03bfa6014cd94ffc86de130b9deb17e4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 12 Aug 2025 17:31:25 +0200 Subject: [PATCH] service: fix object nesting in the ubus get_data call Depending on the contents, instance sub-objects can be confused with per-service data items. Fix the nesting by making an instance object for service items. Signed-off-by: Felix Fietkau --- service/service.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/service/service.c b/service/service.c index 515c992..4070e74 100644 --- a/service/service.c +++ b/service/service.c @@ -838,10 +838,15 @@ service_get_data(struct ubus_context *ctx, struct ubus_object *obj, if (!cs) cs = blobmsg_open_table(&b, s->name); + if (!ci) + ci = blobmsg_open_table(&b, "*"); blobmsg_add_blob(&b, var->data); } + if (ci) + blobmsg_close_table(&b, ci); + vlist_for_each_element(&s->instances, in, node) { ci = NULL; -- 2.30.2