]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: disable stream app tracking on no parser
authorVictor Julien <vjulien@oisf.net>
Wed, 13 Apr 2022 12:00:37 +0000 (14:00 +0200)
committerVictor Julien <vjulien@oisf.net>
Fri, 15 Apr 2022 11:49:48 +0000 (13:49 +0200)
If protocol has no parser enabled or implemented, disable the app
progress tracking in the stream engine to reduce the workload in
the stream engine.

src/app-layer-parser.c

index 97172b704666e714991fabd84a33e9662463f401..43accd7217ce2617a5ee66ee1f614421e04b9222 100644 (file)
@@ -1259,8 +1259,12 @@ int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *alp_tctx, Flow
     const uint8_t direction = (flags & STREAM_TOSERVER) ? 0 : 1;
 
     /* we don't have the parser registered for this protocol */
-    if (p->StateAlloc == NULL)
+    if (p->StateAlloc == NULL) {
+        if (f->proto == IPPROTO_TCP) {
+            StreamTcpDisableAppLayer(f);
+        }
         goto end;
+    }
 
     if (flags & STREAM_GAP) {
         if (!(p->option_flags & APP_LAYER_PARSER_OPT_ACCEPT_GAPS)) {