From 7306f1bec985d82de87b5e379374ecdfb79fbb6b Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Tue, 8 Feb 2022 17:31:59 -0800 Subject: [PATCH] Don't update remote client CIDs gratuitously Handling retire_prior_to might have already moved us off the initial CID. --- quinn-proto/src/connection/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index 7023da86c..178b8864f 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -2503,10 +2503,11 @@ impl Connection { } if self.side.is_server() && self.peer_params.stateless_reset_token.is_none() { - // We're a server using the initial remote CID for the client, so let's - // switch immediately to enable clientside stateless resets. - debug_assert_eq!(self.rem_cids.active_seq(), 0); - self.update_rem_cid().unwrap(); + if self.rem_cids.active_seq() == 0 { + // We're a server still using the initial remote CID for the client, so + // let's switch immediately to enable clientside stateless resets. + let _ = self.update_rem_cid(); + } } else if self.rem_cids.is_active_retired() { // If our current CID is meant to be retired; or // active remote CID is invalid (due to packet loss or reordering),