diff --git a/src/tm-threads.c b/src/tm-threads.c index 63bf3be19d..b173cb84f4 100644 --- a/src/tm-threads.c +++ b/src/tm-threads.c @@ -142,9 +142,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; + } } } @@ -661,6 +663,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 ec791bea47..4ca55f9bc7 100644 --- a/src/tm-threads.h +++ b/src/tm-threads.h @@ -63,14 +63,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;