From: Victor Julien Date: Thu, 30 Jul 2020 11:22:15 +0000 (+0200) Subject: flow: avoid double state update on reuse X-Git-Tag: suricata-6.0.0-beta1~73 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b13c1b804f6411753e4b86b05226fc82d44691a;p=thirdparty%2Fsuricata.git flow: avoid double state update on reuse Avoids an unnecessary atomic operation. --- diff --git a/src/flow-hash.c b/src/flow-hash.c index 17fec620ca..7c590016c3 100644 --- a/src/flow-hash.c +++ b/src/flow-hash.c @@ -574,6 +574,7 @@ static Flow *TcpReuseReplace(ThreadVars *tv, DecodeThreadVars *dtv, FlowInit(f, p); f->flow_hash = hash; f->fb = fb; + FlowUpdateState(f, FLOW_STATE_NEW); f->thread_id[0] = thread_id[0]; f->thread_id[1] = thread_id[1]; @@ -952,8 +953,6 @@ static Flow *FlowGetUsedFlow(ThreadVars *tv, DecodeThreadVars *dtv) FlowClearMemory(f, f->protomap); - FlowUpdateState(f, FLOW_STATE_NEW); - FLOWLOCK_UNLOCK(f); return f; }