]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
afl: fix compilation
authorVictor Julien <victor@inliniac.net>
Fri, 7 Feb 2020 13:50:39 +0000 (14:50 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 11 Feb 2020 09:09:35 +0000 (10:09 +0100)
(cherry picked from commit f05c12b70f78d5369ec19c5759db033fb103f052)

src/tm-threads.c

index c7cc6fe5049f30b0b941e143a06f624a5b368da3..95c14e1a5d3a2e958018a89c56eed3d084033968 100644 (file)
@@ -172,6 +172,27 @@ TmEcode TmThreadsSlotVarRun(ThreadVars *tv, Packet *p,
     return TM_ECODE_OK;
 }
 
+/** \internal
+ *  \brief check 'slot' pre_pq and post_pq at thread cleanup
+ *         and dump detailed info about the state of the packets
+ *         and threads if in a unexpected state.
+ */
+static void CheckSlot(const TmSlot *slot)
+{
+    if (slot->slot_pre_pq.len || slot->slot_post_pq.len) {
+        for (Packet *xp = slot->slot_pre_pq.top; xp != NULL; xp = xp->next) {
+            SCLogNotice("pre_pq: slot id %u slot tm_id %u pre_pq.len %u packet src %s",
+                    slot->id, slot->tm_id, slot->slot_pre_pq.len, PktSrcToString(xp->pkt_src));
+        }
+        for (Packet *xp = slot->slot_post_pq.top; xp != NULL; xp = xp->next) {
+            SCLogNotice("post_pq: slot id %u slot tm_id %u post_pq.len %u packet src %s",
+                    slot->id, slot->tm_id, slot->slot_post_pq.len, PktSrcToString(xp->pkt_src));
+        }
+        TmThreadDumpThreads();
+        abort();
+    }
+}
+
 #ifndef AFLFUZZ_PCAP_RUNMODE
 
 /** \internal
@@ -229,27 +250,6 @@ static int TmThreadTimeoutLoop(ThreadVars *tv, TmSlot *s)
     return r;
 }
 
-/** \internal
- *  \brief check 'slot' pre_pq and post_pq at thread cleanup
- *         and dump detailed info about the state of the packets
- *         and threads if in a unexpected state.
- */
-static void CheckSlot(const TmSlot *slot)
-{
-    if (slot->slot_pre_pq.len || slot->slot_post_pq.len) {
-        for (Packet *xp = slot->slot_pre_pq.top; xp != NULL; xp = xp->next) {
-            SCLogNotice("pre_pq: slot id %u slot tm_id %u pre_pq.len %u packet src %s",
-                    slot->id, slot->tm_id, slot->slot_pre_pq.len, PktSrcToString(xp->pkt_src));
-        }
-        for (Packet *xp = slot->slot_post_pq.top; xp != NULL; xp = xp->next) {
-            SCLogNotice("post_pq: slot id %u slot tm_id %u post_pq.len %u packet src %s",
-                    slot->id, slot->tm_id, slot->slot_post_pq.len, PktSrcToString(xp->pkt_src));
-        }
-        TmThreadDumpThreads();
-        abort();
-    }
-}
-
 /*
 
     pcap/nfq