Skip to content

Commit

Permalink
fix(s2n-quic-dc): resolve unspecified peer addrs on connect (#2408)
Browse files Browse the repository at this point in the history
  • Loading branch information
camshaft authored Dec 9, 2024
1 parent 645c36a commit 6d97280
Showing 1 changed file with 9 additions and 1 deletion.
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();
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

0 comments on commit 6d97280

Please sign in to comment.