]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow: apply flow to packet on flow lookup
authorVictor Julien <vjulien@oisf.net>
Wed, 31 May 2023 13:45:40 +0000 (15:45 +0200)
committerVictor Julien <vjulien@oisf.net>
Fri, 2 Jun 2023 10:07:44 +0000 (12:07 +0200)
Issue drop to packet as early as possible.

(cherry picked from commit 71a033ac62e0b71953f1884ecba7e6461c744197)

src/flow.c

index 031728bd60e55175a8ddf9fa8b4655d7901e72eb..410109766b1e92911c71c71211e6e888ed4039b6 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "suricata-common.h"
 #include "suricata.h"
+
+#include "action-globals.h"
 #include "decode.h"
 #include "conf.h"
 #include "threadvars.h"
@@ -473,6 +475,9 @@ void FlowHandlePacketUpdate(Flow *f, Packet *p, ThreadVars *tv, DecodeThreadVars
         FlowUpdateState(f, FLOW_STATE_ESTABLISHED);
     }
 
+    if (f->flags & FLOW_ACTION_DROP) {
+        PacketDrop(p, ACTION_DROP, PKT_DROP_REASON_FLOW_DROP);
+    }
     /*set the detection bypass flags*/
     if (f->flags & FLOW_NOPACKET_INSPECTION) {
         SCLogDebug("setting FLOW_NOPACKET_INSPECTION flag on flow %p", f);