From: Victor Julien Date: Mon, 20 Jul 2020 12:30:39 +0000 (+0200) Subject: nfs: check post-gap timeouts once a second at most X-Git-Tag: suricata-5.0.4~40 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54d4a8ffb09ca04806b4bd420abd3955fdcf0417;p=thirdparty%2Fsuricata.git nfs: check post-gap timeouts once a second at most Based on 25f2efe97749611760e6e26d388b420091423732 (cherry picked from commit 760d6c187718ed1051607a766a51bfcbeb56c823) --- diff --git a/rust/src/nfs/nfs.rs b/rust/src/nfs/nfs.rs index b9dcd59c33..f1c822a214 100644 --- a/rust/src/nfs/nfs.rs +++ b/rust/src/nfs/nfs.rs @@ -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 }