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-5.0.5~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=264eecbdefacbbf807c17b6de73a32ee607c255d;p=thirdparty%2Fsuricata.git smb: update ts only if it changed (cherry picked from commit 8aa380600da15b95e74a6649e6003a1c484c4ce0) --- diff --git a/rust/src/smb/smb.rs b/rust/src/smb/smb.rs index 5dd9c77b85..e785c1cf6e 100644 --- a/rust/src/smb/smb.rs +++ b/rust/src/smb/smb.rs @@ -930,6 +930,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. */ @@ -1848,7 +1854,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()); if state.parse_tcp_data_ts(buf) == 0 { return 1; } else { @@ -1887,7 +1893,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()); if state.parse_tcp_data_tc(buf) == 0 { return 1; } else {