]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: simplify drop handling
authorVictor Julien <vjulien@oisf.net>
Wed, 31 May 2023 13:52:54 +0000 (15:52 +0200)
committerVictor Julien <vjulien@oisf.net>
Fri, 2 Jun 2023 10:16:58 +0000 (12:16 +0200)
Remove logic to apply flow drop, as this is now handled in the
flow engine.

However, keep the logic that frees/cleans the session state.

(cherry picked from commit d91a1e8bc6b886bdd383f3f7105ef9b2bf3a33fe)

src/stream-tcp.c

index 6c83ffb0611745e4f9b32a95070073ac5324cf31..2a921b31df1ab7fb7472a15c8774486b818316f1 100644 (file)
@@ -5107,11 +5107,9 @@ int StreamTcpPacket (ThreadVars *tv, Packet *p, StreamTcpThread *stt,
      * applayer detection, then drop the rest of the packets of the
      * same stream and avoid inspecting it any further */
     if (StreamTcpCheckFlowDrops(p) == 1) {
-        SCLogDebug("This flow/stream triggered a drop rule");
-        FlowSetNoPacketInspectionFlag(p->flow);
-        DecodeSetNoPacketInspectionFlag(p);
+        DEBUG_VALIDATE_BUG_ON(!(PKT_IS_PSEUDOPKT(p)) && !PACKET_TEST_ACTION(p, ACTION_DROP));
+        SCLogDebug("flow triggered a drop rule");
         StreamTcpDisableAppLayer(p->flow);
-        PacketDrop(p, ACTION_DROP, PKT_DROP_REASON_FLOW_DROP);
         /* return the segments to the pool */
         StreamTcpSessionPktFree(p);
         SCReturnInt(0);