[PATCH] ubus/lua: pass event type as a parameter

manuel.tabares at netduma.com manuel.tabares at netduma.com
Fri Aug 27 04:49:28 PDT 2021


From: Manuel Tabares <manuel.tabares at netduma.com>

Pass the event type as a parameter to the event callback.

Signed-off-by: Manuel Tabares <manuel.tabares at netduma.com>
---
 lua/ubus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lua/ubus.c b/lua/ubus.c
index e2bb081..cbe4a69 100644
--- a/lua/ubus.c
+++ b/lua/ubus.c
@@ -713,7 +713,8 @@ ubus_event_handler(struct ubus_context *ctx, struct ubus_event_handler *ev,
 
 	if (lua_isfunction(state, -1)) {
 		ubus_lua_parse_blob_array(state, blob_data(msg), blob_len(msg), true);
-		lua_call(state, 1, 0);
++		lua_pushstring(state, type);
++		lua_call(state, 2, 0);
 	} else {
 		lua_pop(state, 1);
 	}
-- 
2.25.1




More information about the openwrt-devel mailing list