]> git.ipfire.org Git - thirdparty/suricata.git/commit
flow: fix and simplify locking
authorVictor Julien <vjulien@oisf.net>
Fri, 8 Apr 2022 20:06:09 +0000 (22:06 +0200)
committerVictor Julien <vjulien@oisf.net>
Sat, 9 Apr 2022 15:13:38 +0000 (17:13 +0200)
commit57533d3e47315e6b96c941fe5fd64149cbeb8b1a
tree2999b55653b62a11f14dd5e07ed8e5bf35a50289
parent7eb279ac535c91b7d0af733aa1b57b2e6a4b66df
flow: fix and simplify locking

Since:

9551cd053579 ("threading: don't pass locked flow between threads")

`MoveToWorkQueue()` unconditionally unlocks the flow. This allows simpler
locking handling, including of tcp reuse flows.

The simpler logic also fixes a scenario where TCP reuse flows got "unlocked"
twice, once in `FlowGetFlowFromHash()` and once in `MoveToWorkQueue()`.

Bug: #5248.
Coverity: 1494354.
src/flow-hash.c