Skip to content

Commit

Permalink
afl: fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
victorjulien committed Feb 7, 2020
1 parent 01862ea commit f05c12b
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/tm-threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f05c12b

Please sign in to comment.