diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-24 01:56:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-24 01:56:35 +0000 |
commit | ea7b101b409c45955f5d5446bb3bfdf7758b9226 (patch) | |
tree | aca5d4fbf94bc524c392a5dd9cf4571f3a29ccb8 /src/flow-timeout.c | |
parent | Adding upstream version 1:7.0.4. (diff) | |
download | suricata-upstream.tar.xz suricata-upstream.zip |
Adding upstream version 1:7.0.5.upstream/1%7.0.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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]); } /** |