Skip to content

Commit

Permalink
fix path comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft committed Aug 10, 2023
1 parent 8dc45ef commit ea30846
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ rust-toolchain
**/.github
**/docs
**/scripts
**/specs
**/specs
**/perf.data*
7 changes: 5 additions & 2 deletions quic/s2n-quic-transport/src/path/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,12 @@ impl<Config: endpoint::Config> Manager<Config> {
for (idx, path) in self.paths.iter_mut().enumerate() {
let is_match = if Config::ENDPOINT_TYPE.is_client() {
// only compare remote addresses in the case of a local rebind
path.handle.remote_address() == path_handle.remote_address()
s2n_quic_core::path::Handle::eq(
&path.handle.remote_address(),
&path_handle.remote_address(),
)
} else {
path.handle.eq(path_handle)
path.eq_by_handle(path_handle)
};

if !is_match {
Expand Down
5 changes: 3 additions & 2 deletions quic/s2n-quic-transport/src/path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,9 +547,10 @@ impl<Config: endpoint::Config> Path<Config> {

// Compare a Path based on its PathHandle.
//
// Currently the local_address on the Client connection is unknown and set to
// a default un-specified value; therefore only the remote_address is used
// In case the local_address on the connection is unknown and set to
// a default un-specified value only the remote_address is used
// to compare Paths.
#[inline]
fn eq_by_handle(&self, handle: &Config::PathHandle) -> bool {
if self.handle.local_address().port() == 0 {
// Only compare the remote address if we haven't updated the local yet
Expand Down

0 comments on commit ea30846

Please sign in to comment.