]> 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, 25 Aug 2020 12:49:26 +0000 (14:49 +0200)
Based on 25f2efe97749611760e6e26d388b420091423732

(cherry picked from commit 760d6c187718ed1051607a766a51bfcbeb56c823)

rust/src/nfs/nfs.rs

index b9dcd59c3328d95229850f200e2ab9766123c5cd..f1c822a214c9f514a737730ef54fe31b8ce865e7 100644 (file)
@@ -346,6 +346,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,
 
@@ -380,6 +381,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,
@@ -390,6 +392,7 @@ impl NFSState {
     fn update_ts(&mut self, ts: u64) {
         if ts != self.ts {
             self.ts = ts;
+            self.post_gap_files_checked = false;
         }
     }
 
@@ -1207,8 +1210,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;
         }
 
         status
@@ -1370,8 +1374,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;
         }
         status
     }