]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/filestore: clean up stream flag handling
authorVictor Julien <vjulien@oisf.net>
Fri, 10 Jun 2022 08:34:47 +0000 (10:34 +0200)
committerVictor Julien <vjulien@oisf.net>
Thu, 16 Jun 2022 15:28:43 +0000 (17:28 +0200)
src/detect-filestore.c

index 2e53572f56f459cda197a7d3c1d6124676ad1c18..d7077c59c917a92360e0a7700e61187db02d390d 100644 (file)
@@ -198,8 +198,6 @@ static int FilestorePostMatchWithOptions(Packet *p, Flow *f, const DetectFilesto
 static int DetectFilestorePostMatch(DetectEngineThreadCtx *det_ctx,
         Packet *p, const Signature *s, const SigMatchCtx *ctx)
 {
-    uint8_t flags = 0;
-
     SCEnter();
 
     if (det_ctx->filestore_cnt == 0) {
@@ -219,11 +217,8 @@ static int DetectFilestorePostMatch(DetectEngineThreadCtx *det_ctx,
         TcpSession *ssn = (TcpSession *)p->flow->protoctx;
         TcpSessionSetReassemblyDepth(ssn, FileReassemblyDepth());
     }
-    if (p->flowflags & FLOW_PKT_TOCLIENT)
-        flags |= STREAM_TOCLIENT;
-    else
-        flags |= STREAM_TOSERVER;
 
+    const uint8_t flags = STREAM_FLAGS_FOR_PACKET(p);
     for (uint16_t u = 0; u < det_ctx->filestore_cnt; u++) {
         AppLayerParserSetStreamDepthFlag(p->flow->proto, p->flow->alproto,
                                          FlowGetAppState(p->flow),