-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix(s2n-quic-transport): fix client connection migration when local address handle changes #1874
Conversation
47e3528
to
298e423
Compare
298e423
to
2457fd5
Compare
2457fd5
to
8dc45ef
Compare
This change breaks the interop tests. Marking as draft for now. |
ea30846
to
a2045a3
Compare
Should be fixed now |
quic/s2n-quic-core/src/path/mod.rs
Outdated
@@ -250,6 +258,11 @@ impl Handle for Tuple { | |||
self.local_address = other.local_address; | |||
} | |||
} | |||
|
|||
#[inline] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would it also work if you just changed maybe_update
to something like:
fn maybe_update(&mut self, other: &Self) {
if self.local_address.port() != other.local_address.port() {
self.local_address = other.local_address;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's probably cleaner; although we should probably check that other.port() != 0
, just to make sure we're not accidentally clearing information
fn eq_by_handle(&self, handle: &Config::PathHandle) -> bool { | ||
if self.handle.local_address().port() == 0 { | ||
if Config::ENDPOINT_TYPE.is_client() || self.handle.local_address().port() == 0 { | ||
// Only compare the remote address if we haven't updated the local yet |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll just remove this one since it's documented as part of the function above
a2045a3
to
b6127c2
Compare
quic/s2n-quic-core/src/path/mod.rs
Outdated
return; | ||
} | ||
|
||
// once we discover our path, or the port changes, update the address full address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know its just copy-pasted, but update the address full address
isn't making sense to me grammatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i should have more carefully read it 😄. i'll fix it
b6127c2
to
cf29aed
Compare
Description of changes:
There's a bit of an issue on the client with matching incoming packets to stored paths in the case of connection migration. If the local address changes, we end up rejecting the server's packet and the connection times out. You can see this issue by removing the fix and running the integration test.
The fix, instead, finds paths based on the server's address alone and then updates the local address if it has changed.
Testing:
I've included an integration test showing path migration working with this change.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.