]> 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)
committerVictor Julien <vjulien@oisf.net>
Mon, 18 Mar 2024 16:09:16 +0000 (17:09 +0100)
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 a20e053c59c9e5a38432104f3e4147626e35c246..50d690d3b9993f3c5e3ff7fa62f4ae4019a92418 100644 (file)
@@ -430,6 +430,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,