diff --git a/src/detect-engine-prefilter.c b/src/detect-engine-prefilter.c index d68b738b6c..289ba93bcf 100644 --- a/src/detect-engine-prefilter.c +++ b/src/detect-engine-prefilter.c @@ -945,10 +945,11 @@ static int SetupNonPrefilter(DetectEngineCtx *de_ctx, SigGroupHead *sgh) for (uint8_t state = 0; state < s->app_progress_hook; state++) { SCLogDebug("handle HOOK %u LTE", state); const int dir = (s->flags & SIG_FLAG_TOSERVER) ? 0 : 1; - const char *pname = AppLayerParserGetStateNameById(IPPROTO_TCP, // TODO + const char *pname = DetectEngineAppHookToName( s->alproto, state, dir == 0 ? STREAM_TOSERVER : STREAM_TOCLIENT); - if (pname == NULL) + if (pname == NULL) { goto error; + } const int sm_list = DetectEngineAppHookToSmlist( s->alproto, state, dir == 0 ? STREAM_TOSERVER : STREAM_TOCLIENT); if (TxNonPFAddSig(de_ctx, tx_engines_hash, s->alproto, dir, (int16_t)state, sm_list, diff --git a/src/detect-engine.c b/src/detect-engine.c index 111ffd71c8..4c0abddb0a 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -849,10 +849,11 @@ int DetectEngineAppHookToSmlist(const AppProto p, const uint8_t state, const int if (strcmp(app_proto, "http") == 0) app_proto = "http1"; - const char *name = AppLayerParserGetStateNameById( - IPPROTO_TCP, p, state, direction & (STREAM_TOSERVER | STREAM_TOCLIENT)); - if (name == NULL) + const char *name = + DetectEngineAppHookToName(p, state, direction & (STREAM_TOSERVER | STREAM_TOCLIENT)); + if (name == NULL) { return -1; + } char generic_hook_name[256]; snprintf(generic_hook_name, sizeof(generic_hook_name), "%s:%s:generic", app_proto, name);