From: Manuel Tabares <[email protected]>

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

Signed-off-by: Manuel Tabares <[email protected]>
---
 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


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to