[openwrt/openwrt] ucode: ubus: add shared global connection to uloop

LEDE Commits lede-commits at lists.infradead.org
Wed Sep 17 03:28:06 PDT 2025


nbd pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5b8f185e2783433ffcb63c01e337ac07f66e2878

commit 5b8f185e2783433ffcb63c01e337ac07f66e2878
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Wed Sep 17 12:27:00 2025 +0200

    ucode: ubus: add shared global connection to uloop
    
    Fixes issues with registering objects
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 .../patches/100-ubus-add-connection-functions-to-global-scope.patch | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/package/utils/ucode/patches/100-ubus-add-connection-functions-to-global-scope.patch b/package/utils/ucode/patches/100-ubus-add-connection-functions-to-global-scope.patch
index 33136449a7..4a232346ff 100644
--- a/package/utils/ucode/patches/100-ubus-add-connection-functions-to-global-scope.patch
+++ b/package/utils/ucode/patches/100-ubus-add-connection-functions-to-global-scope.patch
@@ -9,7 +9,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 
 --- a/lib/ubus.c
 +++ b/lib/ubus.c
-@@ -511,16 +511,40 @@ uc_ubus_objects_cb(struct ubus_context *
+@@ -511,16 +511,42 @@ uc_ubus_objects_cb(struct ubus_context *
  static bool
  _conn_get(uc_vm_t *vm, uc_ubus_connection_t **conn)
  {
@@ -36,6 +36,8 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +			ucv_put(c->res);
 +			err_return(UBUS_STATUS_UNKNOWN_ERROR, "Unable to connect to ubus socket");
 +		}
++
++		ubus_add_uloop(&c->ctx);
  
 -	if (c->ctx.sock.fd < 0)
 -		err_return(UBUS_STATUS_CONNECTION_FAILED, "Connection is closed");
@@ -57,7 +59,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
  	*conn = c;
  
  	ok_return(true);
-@@ -2606,6 +2630,7 @@ static void free_request(void *ud) {
+@@ -2606,6 +2632,7 @@ static void free_request(void *ud) {
  void uc_module_init(uc_vm_t *vm, uc_value_t *scope)
  {
  	uc_function_list_register(scope, global_fns);




More information about the lede-commits mailing list