-
Notifications
You must be signed in to change notification settings - Fork 10
Ry/faster syn expiry #987
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: timeouts-timeouts
Are you sure you want to change the base?
Ry/faster syn expiry #987
Changes from 3 commits
81cea6b
fc02a5e
a114c80
3e26a13
225e206
324103b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| // License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| // file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
|
||
| // Copyright 2025 Oxide Computer Company | ||
| // Copyright 2026 Oxide Computer Company | ||
|
|
||
| //! A virtual switch port. | ||
|
|
||
|
|
@@ -44,6 +44,7 @@ use super::rule::HdrTransformError; | |
| use super::rule::PresavedMeoi; | ||
| use super::rule::Rule; | ||
| use super::rule::TransformFlags; | ||
| use super::tcp::INCIPIENT_EXPIRE_TTL; | ||
| use super::tcp::KEEPALIVE_EXPIRE_TTL; | ||
| use super::tcp::TIME_WAIT_EXPIRE_TTL; | ||
| use super::tcp_state::TcpFlowState; | ||
|
|
@@ -2992,14 +2993,16 @@ impl Dump for TcpFlowEntryState { | |
| /// Expiry behaviour for TCP flows dependent on the connection FSM. | ||
| #[derive(Debug)] | ||
| pub struct TcpExpiry { | ||
| time_wait_ttl: Ttl, | ||
| incipient_ttl: Ttl, | ||
| quiescent_ttl: Ttl, | ||
| keepalive_ttl: Ttl, | ||
| } | ||
|
|
||
| impl Default for TcpExpiry { | ||
| fn default() -> Self { | ||
| Self { | ||
| time_wait_ttl: TIME_WAIT_EXPIRE_TTL, | ||
| incipient_ttl: INCIPIENT_EXPIRE_TTL, | ||
| quiescent_ttl: TIME_WAIT_EXPIRE_TTL, | ||
| keepalive_ttl: KEEPALIVE_EXPIRE_TTL, | ||
| } | ||
| } | ||
|
|
@@ -3012,8 +3015,16 @@ impl ExpiryPolicy<TcpFlowEntryState> for TcpExpiry { | |
| now: Moment, | ||
| ) -> bool { | ||
| let ttl = match entry.state().tcp_state() { | ||
| TcpState::TimeWait => self.time_wait_ttl, | ||
| _ => self.keepalive_ttl, | ||
| TcpState::TimeWait | ||
| | TcpState::LastAck | ||
| | TcpState::CloseWait | ||
| | TcpState::FinWait1 | ||
| | TcpState::FinWait2 => self.quiescent_ttl, | ||
| TcpState::SynSent | TcpState::SynRcvd | TcpState::Listen => { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm slightly concerned about
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| self.incipient_ttl | ||
| } | ||
| TcpState::Established => self.keepalive_ttl, | ||
| TcpState::Closed => Ttl::new_seconds(0), | ||
| }; | ||
| ttl.is_expired(entry.last_hit(), now) | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.