From 1d9802f2e43c19f95205e74028d0f673080b9074 Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 30 Oct 2024 02:13:40 +1100 Subject: [PATCH] fix(connlib): don't add host candidates multiple times (#7172) We introduced a boolean bug in #7163 that causes us to attempt to add host candidates much more often than necessary. This spams the logs on DEBUG level but was otherwise not harmful. --- rust/connlib/snownet/src/node.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/connlib/snownet/src/node.rs b/rust/connlib/snownet/src/node.rs index f8931caec..c3f76a679 100644 --- a/rust/connlib/snownet/src/node.rs +++ b/rust/connlib/snownet/src/node.rs @@ -744,7 +744,7 @@ where fn add_local_as_host_candidate(&mut self, local: SocketAddr) -> Result<(), Error> { let host_candidate = Candidate::host(local, Protocol::Udp)?; - if self.shared_candidates.insert(host_candidate.clone()) { + if !self.shared_candidates.insert(host_candidate.clone()) { return Ok(()); }