From: Philippe Antoine Date: Tue, 3 Oct 2023 10:39:13 +0000 (+0200) Subject: detect: update packet action on protocol change X-Git-Tag: suricata-8.0.0-beta1~1609 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c4f7ff1a2324bff9e4e09dd8354878b2455ac34;p=thirdparty%2Fsuricata.git detect: update packet action on protocol change 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 --- diff --git a/src/flow-worker.c b/src/flow-worker.c index 77fe2b87fe..a34ec725c9 100644 --- a/src/flow-worker.c +++ b/src/flow-worker.c @@ -410,6 +410,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,