diff --git a/rust/connlib/snownet/src/node.rs b/rust/connlib/snownet/src/node.rs index da633a94d..733cbea7a 100644 --- a/rust/connlib/snownet/src/node.rs +++ b/rust/connlib/snownet/src/node.rs @@ -38,6 +38,9 @@ const HANDSHAKE_RATE_LIMIT: u64 = 100; /// How long we will at most wait for a candidate from the remote. const CANDIDATE_TIMEOUT: Duration = Duration::from_secs(10); +/// How long we will at most wait for an [`Answer`] from the remote. +const HANDSHAKE_TIMEOUT: Duration = Duration::from_secs(20); + const MAX_UDP_SIZE: usize = (1 << 16) - 1; /// Manages a set of wireguard connections for a server. @@ -1213,7 +1216,7 @@ impl InitialConnection { where TId: fmt::Display, { - if now.duration_since(self.created_at) >= Duration::from_secs(20) { + if now.duration_since(self.created_at) >= HANDSHAKE_TIMEOUT { tracing::info!(%id, "Connection setup timed out (no answer received)"); self.is_failed = true; }