From d91a1e8bc6b886bdd383f3f7105ef9b2bf3a33fe Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Wed, 31 May 2023 15:52:54 +0200 Subject: [PATCH] stream: simplify drop handling 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. --- src/stream-tcp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/stream-tcp.c b/src/stream-tcp.c index 5c355ee723..ec87745c3b 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -5356,11 +5356,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)) && !PacketCheckAction(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);