]> git.ipfire.org Git - thirdparty/suricata.git/commit
threads: fix missed logging at shutdown 2518/head
authorVictor Julien <victor@inliniac.net>
Thu, 26 Jan 2017 09:16:53 +0000 (10:16 +0100)
committerVictor Julien <victor@inliniac.net>
Thu, 26 Jan 2017 09:23:13 +0000 (10:23 +0100)
commit3c64cfb384dd82372644fc3ff1e6e5d0c7b82043
tree2fe79c70d31c8bb1afd07c03ff8b73653fd5b409
parentf73806211a93f40873d08d865c51fba3e3d11ce9
threads: fix missed logging at shutdown

At shutdown, all flows that still need work are handled by the flow
force reassembly logic. This means one or more flow end pseudo packets
are generated and pushed through the engine for final detection and
logging.

In some cases this would not work correctly. This was caused by the
flow timeout logic kicking in before all the 'live' packets were
processed. Before the flow timeout handling runs the receive threads
are disabled, however the engine did not wait for the in-flight
packets to be fully processed. In autofp mode, packets could still
be in the queue between receive thread(s) and flow worker(s).

This patch adds a new function that 'drains' all the packet threads
of any in-progress packets before moving on the flow timeout logic.

Bug #1946.
src/tm-threads.c