From d937f392d3cbd3243a25de608c93bf603b3a4f5d Mon Sep 17 00:00:00 2001 From: lubeilin <1791778603@qq.com> Date: Wed, 26 Jul 2023 21:30:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=90=86icmp?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnt/src/core/mod.rs | 3 ++- vnt/src/ip_proxy/mod.rs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vnt/src/core/mod.rs b/vnt/src/core/mod.rs index 0beba1d..d789be7 100644 --- a/vnt/src/core/mod.rs +++ b/vnt/src/core/mod.rs @@ -1,3 +1,4 @@ +use std::collections::HashSet; use std::io; use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4}; use std::sync::Arc; @@ -183,7 +184,7 @@ impl VntUtil { // NAT检测 let nat_test = NatTest::new(config.nat_test_server.clone(), response.public_ip, response.public_port, local_ip, local_port); - let out_ips = config.out_ips.iter().map(|(_, _, ip)| *ip).collect::>(); + let out_ips = config.out_ips.iter().map(|(_, _, ip)| *ip).collect::>(); let out_external_route = ExternalRoute::new(config.out_ips); let in_external_route = if config.in_ips.is_empty() { None diff --git a/vnt/src/ip_proxy/mod.rs b/vnt/src/ip_proxy/mod.rs index d4a59a0..4f25dc2 100644 --- a/vnt/src/ip_proxy/mod.rs +++ b/vnt/src/ip_proxy/mod.rs @@ -1,5 +1,5 @@ use std::{io, thread}; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; use std::net::{Ipv4Addr, SocketAddrV4}; use std::sync::Arc; use crossbeam_utils::atomic::AtomicCell; @@ -45,7 +45,7 @@ impl IpProxyMap { } } -pub async fn init_proxy(sender: ChannelSender, bind_ips: Vec, current_device: Arc>) -> io::Result<(TcpProxy, UdpProxy, IpProxyMap)> { +pub async fn init_proxy(sender: ChannelSender, bind_ips: HashSet, current_device: Arc>) -> io::Result<(TcpProxy, UdpProxy, IpProxyMap)> { let mut icmp_sockets = HashMap::new(); let tcp_proxy_map: Arc> = Arc::new(SkipMap::new()); let udp_proxy_map: Arc> = Arc::new(SkipMap::new());