From 264eecbdefacbbf807c17b6de73a32ee607c255d Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sun, 17 May 2020 14:48:52 +0200 Subject: [PATCH] smb: update ts only if it changed (cherry picked from commit 8aa380600da15b95e74a6649e6003a1c484c4ce0) --- rust/src/smb/smb.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 { -- 2.47.2