From: Victor Julien Date: Fri, 7 Feb 2020 13:50:39 +0000 (+0100) Subject: afl: fix compilation X-Git-Tag: suricata-5.0.2~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=43ee9d8b9bfafc98594f7c21dc0b8aafb52663c0;p=thirdparty%2Fsuricata.git afl: fix compilation (cherry picked from commit f05c12b70f78d5369ec19c5759db033fb103f052) --- diff --git a/src/tm-threads.c b/src/tm-threads.c index c7cc6fe504..95c14e1a5d 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -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