]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
nfs: check post-gap timeouts once a second at most
authorVictor Julien <victor@inliniac.net>
Mon, 20 Jul 2020 12:30:39 +0000 (14:30 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 21 Jul 2020 14:50:26 +0000 (16:50 +0200)
Based on 25f2efe97749611760e6e26d388b420091423732

rust/src/nfs/nfs.rs

index 2fbe6566f6c0f989ca7f9f9cc9dc22d1123dd99d..b4621339d1e45e746604d311a379459bc7755a17 100644 (file)
@@ -338,6 +338,7 @@ pub struct NFSState {
     /// true as long as we have file txs that are in a post-gap
     /// state. It means we'll do extra house keeping for those.
     check_post_gap_file_txs: bool,
+    post_gap_files_checked: bool,
 
     pub nfs_version: u16,
 
@@ -370,6 +371,7 @@ impl NFSState {
             tc_gap:false,
             is_udp:false,
             check_post_gap_file_txs:false,
+            post_gap_files_checked:false,
             nfs_version:0,
             events:0,
             tx_id:0,
@@ -380,6 +382,7 @@ impl NFSState {
     fn update_ts(&mut self, ts: u64) {
         if ts != self.ts {
             self.ts = ts;
+            self.post_gap_files_checked = false;
         }
     }
 
@@ -1179,8 +1182,9 @@ impl NFSState {
         };
 
         self.post_gap_housekeeping(STREAM_TOSERVER);
-        if self.check_post_gap_file_txs {
+        if self.check_post_gap_file_txs && !self.post_gap_files_checked {
             self.post_gap_housekeeping_for_files();
+            self.post_gap_files_checked = true;
         }
 
         AppLayerResult::ok()
@@ -1329,8 +1333,9 @@ impl NFSState {
             }
         };
         self.post_gap_housekeeping(STREAM_TOCLIENT);
-        if self.check_post_gap_file_txs {
+        if self.check_post_gap_file_txs && !self.post_gap_files_checked {
             self.post_gap_housekeeping_for_files();
+            self.post_gap_files_checked = true;
         }
         AppLayerResult::ok()
     }