mirror of https://github.com/OISF/suricata
flow: modify lastts update logic
In the lastts timeval struct field in the flow the timestamp of the last packet to update is recorded. This allows for tracking the timeout of the flow. So far, this value was updated under the flow lock and also read under the flow lock. This patch moves the updating of this field to the FlowGetFlowFromHash function, where it updated at the point where both the Flow and the Flow Hash Row lock are held. This guarantees that the field is only updated when both locks are held. This makes reading the field safe when either lock is held, which is the purpose of this patch. The flow manager, while holding the flow hash row lock, can now safely read the lastts value. This allows it to do the flow timeout check without actually locking the flow.pull/1315/head
parent
a0732d3db2
commit
5587372ce1
Loading…
Reference in New Issue