]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: update packet action on protocol change
authorPhilippe Antoine <pantoine@oisf.net>
Tue, 3 Oct 2023 10:39:13 +0000 (12:39 +0200)
committerJason Ish <jason.ish@oisf.net>
Mon, 18 Mar 2024 18:03:05 +0000 (12:03 -0600)
Ticket: #6305

When running FlowWorkerStreamTCPUpdate, one of the dequeued packet
may set the flow action to drop, without updating the not-pseudo
packet action, as is done usually with a previous call to
FlowHandlePacketUpdate

(cherry picked from commit 4c4f7ff1a2324bff9e4e09dd8354878b2455ac34)

src/flow-worker.c

index cac66ced4a69b15d294333380053abd855896253..984d790e0d76829de50ba89d3ef2c4180bf08c56 100644 (file)
@@ -404,6 +404,10 @@ static inline void FlowWorkerStreamTCPUpdate(ThreadVars *tv, FlowWorkerThreadDat
             TmqhOutputPacketpool(tv, x);
         }
     }
+    if (FlowChangeProto(p->flow) && p->flow->flags & FLOW_ACTION_DROP) {
+        // in case f->flags & FLOW_ACTION_DROP was set by one of the dequeued packets
+        PacketDrop(p, ACTION_DROP, PKT_DROP_REASON_FLOW_DROP);
+    }
 }
 
 static void FlowWorkerFlowTimeout(ThreadVars *tv, Packet *p, FlowWorkerThreadData *fw,