]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
smb: update ts only if it changed
authorVictor Julien <victor@inliniac.net>
Sun, 17 May 2020 12:48:52 +0000 (14:48 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 6 Jul 2020 20:50:04 +0000 (22:50 +0200)
rust/src/smb/smb.rs

index 45033c37ee6ecd12ac79382ec3c14d72aa16107c..c0c09adde50f9995bf6ada21cc991c093602ae59 100644 (file)
@@ -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)
 }