From 858b0e661713ed75686b7b84f3562887f0f0117a Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Thu, 13 Jul 2023 22:31:47 -0400 Subject: [PATCH] use unbound connections for outbound --- veilid-core/src/network_manager/native/mod.rs | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/veilid-core/src/network_manager/native/mod.rs b/veilid-core/src/network_manager/native/mod.rs index a4cf7854..afc6888a 100644 --- a/veilid-core/src/network_manager/native/mod.rs +++ b/veilid-core/src/network_manager/native/mod.rs @@ -307,22 +307,6 @@ impl Network { local_port } - fn get_preferred_local_address(&self, dial_info: &DialInfo) -> SocketAddr { - let inner = self.inner.lock(); - - let local_port = match dial_info.protocol_type() { - ProtocolType::UDP => inner.udp_port, - ProtocolType::TCP => inner.tcp_port, - ProtocolType::WS => inner.ws_port, - ProtocolType::WSS => inner.wss_port, - }; - - match dial_info.address_type() { - AddressType::IPV4 => SocketAddr::new(IpAddr::V4(Ipv4Addr::UNSPECIFIED), local_port), - AddressType::IPV6 => SocketAddr::new(IpAddr::V6(Ipv6Addr::UNSPECIFIED), local_port), - } - } - pub fn is_usable_interface_address(&self, addr: IpAddr) -> bool { let usable_addrs = self.get_usable_interface_addresses(); usable_addrs.contains(&addr) @@ -594,10 +578,9 @@ impl Network { .wrap_err("failed to send data to dial info")?); } else { // Handle connection-oriented protocols - let local_addr = self.get_preferred_local_address(&dial_info); let conn = network_result_try!( self.connection_manager() - .get_or_create_connection(Some(local_addr), dial_info.clone()) + .get_or_create_connection(None, dial_info.clone()) .await? );