Skip to content

Commit 4c71000

Browse files
authored
fix(bedrock): NetherNet direct connection ICE routing (#3030)
1 parent 5fd0933 commit 4c71000

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

crates/pumpkin/src/net/bedrock/nethernet.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,10 @@ async fn build_peer(
368368
advertised_ip: Option<IpAddr>,
369369
) -> Result<Arc<dyn PeerConnection>, String> {
370370
let ice_bind_addr = if direct_ip {
371-
SocketAddr::new(IpAddr::V4(std::net::Ipv4Addr::UNSPECIFIED), 0)
371+
// Direct connections are relayed through the router's loopback socket.
372+
// Binding every interface would make the inner ICE source differ from
373+
// the loopback route registered after SDP generation.
374+
SocketAddr::new(state.ice_router.internal_addr().ip(), 0)
372375
} else {
373376
SocketAddr::new(state.ice_local_addr.ip(), 0)
374377
};

0 commit comments

Comments
 (0)