From 29db2e4bbe18ac51b30b06808afbf9941f57aef0 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Thu, 27 Mar 2025 11:24:17 -0600 Subject: [PATCH] lua/dnp3: convert done and complete to boolean These were integers, 1 of true, 0 for false. Convert to boolean as that is how they are in eve, and Lua has boolean types. Ticket: #7601 --- src/util-lua-dnp3.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/util-lua-dnp3.c b/src/util-lua-dnp3.c index 3be6076c37..0ad2d1d728 100644 --- a/src/util-lua-dnp3.c +++ b/src/util-lua-dnp3.c @@ -38,7 +38,7 @@ lua_settable(luastate, -3); \ } while (0); -static void SCLuaPushBoolean(lua_State *L, const char *key, bool val) +static void SCLuaPushTableBoolean(lua_State *L, const char *key, bool val) { lua_pushstring(L, key); lua_pushboolean(L, val); @@ -172,19 +172,19 @@ static int DNP3GetTx(lua_State *luastate) lua_pushinteger(luastate, tx->tx_num); lua_settable(luastate, -3); - SCLuaPushBoolean(luastate, "is_request", tx->is_request); + SCLuaPushTableBoolean(luastate, "is_request", tx->is_request); if (tx->is_request) { lua_pushliteral(luastate, "request"); lua_newtable(luastate); - LUA_PUSHT_INT(luastate, "done", tx->done); - LUA_PUSHT_INT(luastate, "complete", tx->complete); + SCLuaPushTableBoolean(luastate, "done", tx->done); + SCLuaPushTableBoolean(luastate, "complete", tx->complete); DNP3PushRequest(luastate, tx); lua_settable(luastate, -3); } else { lua_pushliteral(luastate, "response"); lua_newtable(luastate); - LUA_PUSHT_INT(luastate, "done", tx->done); - LUA_PUSHT_INT(luastate, "complete", tx->complete); + SCLuaPushTableBoolean(luastate, "done", tx->done); + SCLuaPushTableBoolean(luastate, "complete", tx->complete); DNP3PushResponse(luastate, tx); lua_settable(luastate, -3); } -- 2.47.2