Skip to content
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-dc): resolve unspecified peer addrs on connect #2408

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion dc/s2n-quic-dc/src/stream/client/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,21 @@ where
// Make sure TCP_NODELAY is set
let _ = socket.set_nodelay(true);

// if the acceptor_ip isn't known, then ask the socket to resolve it for us
let peer_addr = if acceptor_addr.ip().is_unspecified() {
socket.peer_addr()?
} else {
acceptor_addr
}
.into();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, we were seeing a similar ~bug in the handshake metrics -- maybe we need code like this somewhere in s2n-quic too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I can look into that

let local_port = socket.local_addr()?.port();

let stream = endpoint::open_stream(
env,
peer,
env::TcpRegistered {
socket,
peer_addr: acceptor_addr.into(),
peer_addr,
local_port,
},
subscriber,
Expand Down
Loading