From: Victor Julien Date: Sun, 17 May 2020 12:48:52 +0000 (+0200) Subject: smb: update ts only if it changed X-Git-Tag: suricata-6.0.0-beta1~279 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8aa380600da15b95e74a6649e6003a1c484c4ce0;p=thirdparty%2Fsuricata.git smb: update ts only if it changed --- diff --git a/rust/src/smb/smb.rs b/rust/src/smb/smb.rs index 45033c37ee..c0c09adde5 100644 --- a/rust/src/smb/smb.rs +++ b/rust/src/smb/smb.rs @@ -924,6 +924,12 @@ impl SMBState { return None; } + fn update_ts(&mut self, ts: u64) { + if ts != self.ts { + self.ts = ts; + } + } + /* generic TX has no type_data and is only used to * track a single cmd request/reply pair. */ @@ -1853,7 +1859,7 @@ pub extern "C" fn rs_smb_parse_request_tcp(flow: &mut Flow, state.ts_gap = true; } - state.ts = flow.get_last_time().as_secs(); + state.update_ts(flow.get_last_time().as_secs()); state.parse_tcp_data_ts(buf) } @@ -1885,7 +1891,7 @@ pub extern "C" fn rs_smb_parse_response_tcp(flow: &mut Flow, state.tc_gap = true; } - state.ts = flow.get_last_time().as_secs(); + state.update_ts(flow.get_last_time().as_secs()); state.parse_tcp_data_tc(buf) }