diff --git a/src/tm-threads.c b/src/tm-threads.c index f0b2f823b253..6cc111a0faae 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -140,9 +140,11 @@ TmEcode TmThreadsSlotVarRun(ThreadVars *tv, Packet *p, TmSlot *slot) TmThreadsSlotProcessPktFail(tv, s, NULL); return TM_ECODE_FAILED; } - - if (TmThreadsProcessDecodePseudoPackets(tv, &tv->decode_pq, s->slot_next) != TM_ECODE_OK) { - return TM_ECODE_FAILED; + if (s->tm_flags & TM_FLAG_DECODE_TM) { + if (TmThreadsProcessDecodePseudoPackets(tv, &tv->decode_pq, s->slot_next) != + TM_ECODE_OK) { + return TM_ECODE_FAILED; + } } } @@ -683,6 +685,7 @@ void TmSlotSetFuncAppend(ThreadVars *tv, TmModule *tm, const void *data) /* we don't have to check for the return value "-1". We wouldn't have * received a TM as arg, if it didn't exist */ slot->tm_id = TmModuleGetIDForTM(tm); + slot->tm_flags |= tm->flags; tv->tmm_flags |= tm->flags; tv->cap_flags |= tm->cap_flags; diff --git a/src/tm-threads.h b/src/tm-threads.h index d68c9230a372..3f901e9d26a9 100644 --- a/src/tm-threads.h +++ b/src/tm-threads.h @@ -62,14 +62,18 @@ typedef struct TmSlot_ { SC_ATOMIC_DECLARE(void *, slot_data); + /** copy of the TmModule::flags */ + uint8_t tm_flags; + + /* store the thread module id */ + int tm_id; + TmEcode (*SlotThreadInit)(ThreadVars *, const void *, void **); void (*SlotThreadExitPrintStats)(ThreadVars *, void *); TmEcode (*SlotThreadDeinit)(ThreadVars *, void *); /* data storage */ const void *slot_initdata; - /* store the thread module id */ - int tm_id; } TmSlot;