diff options
Diffstat (limited to 'src/flow-timeout.c')
-rw-r--r-- | src/flow-timeout.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/flow-timeout.c b/src/flow-timeout.c index e5d2794..6efa382 100644 --- a/src/flow-timeout.c +++ b/src/flow-timeout.c @@ -341,14 +341,20 @@ int FlowForceReassemblyNeedReassembly(Flow *f) * * The function requires flow to be locked beforehand. * + * Normally, the first thread_id value should be used. This is when the flow is + * created on seeing the first packet to the server; when the flow's reversed + * flag is set, choose the second thread_id (to client/source). + * * \param f Pointer to the flow. * * \retval 0 This flow doesn't need any reassembly processing; 1 otherwise. */ void FlowForceReassemblyForFlow(Flow *f) { - const int thread_id = (int)f->thread_id[0]; - TmThreadsInjectFlowById(f, thread_id); + // Choose the thread_id based on whether the flow has been + // reversed. + int idx = f->flags & FLOW_DIR_REVERSED ? 1 : 0; + TmThreadsInjectFlowById(f, (const int)f->thread_id[idx]); } /** |