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-6.0.0-beta1~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc7cecb4ae820c098322bb1098cd20902fd84604;p=thirdparty%2Fsuricata.git nfs: check post-gap timeouts once a second at most Based on 25f2efe97749611760e6e26d388b420091423732 --- diff --git a/rust/src/nfs/nfs.rs b/rust/src/nfs/nfs.rs index 2fbe6566f6..b4621339d1 100644 --- a/rust/src/nfs/nfs.rs +++ b/rust/src/nfs/nfs.rs @@ -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() }