From: Victor Julien Date: Thu, 14 Aug 2014 14:33:37 +0000 (+0200) Subject: detect-lua: set tx ptr X-Git-Tag: suricata-2.1beta2~116 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=41523ede77f6675fae5f040e80abf28d65e23cb8;p=thirdparty%2Fsuricata.git detect-lua: set tx ptr Set tx ptr so it can be used later by other keywords. --- diff --git a/src/detect-lua-extensions.c b/src/detect-lua-extensions.c index c29b300913..222b6e55b3 100644 --- a/src/detect-lua-extensions.c +++ b/src/detect-lua-extensions.c @@ -58,6 +58,8 @@ #include "queue.h" #include "util-cpu.h" +#include "app-layer-parser.h" + #ifdef HAVE_LUA #include "util-lua.h" @@ -569,6 +571,15 @@ void LuaExtensionsMatchSetup(lua_State *lua_state, DetectLuaData *ld, DetectEngi lua_settable(lua_state, LUA_REGISTRYINDEX); LuaStateSetFlow(lua_state, f, flow_locked); + + if (det_ctx->tx_id_set && flow_locked == LUA_FLOW_LOCKED_BY_PARENT) { + if (f && f->alstate) { + void *txptr = AppLayerParserGetTx(f->proto, f->alproto, f->alstate, det_ctx->tx_id); + if (txptr) { + LuaStateSetTX(lua_state, txptr); + } + } + } } /**