mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 02:09:06 +00:00
allow specify bind dev for tunnels. also fix bugs #46)
1. fix wireguard / udp tunnel stack overflow on win. 2. custom panic handler to save panic stack. 3. fix iface filter on windows and linux. 4. add scheme black list to direct connector
This commit is contained in:
+2
-3
@@ -19,8 +19,6 @@ use windows_sys::{
|
||||
},
|
||||
};
|
||||
|
||||
use crate::tunnels::common::get_interface_name_by_ip;
|
||||
|
||||
pub fn disable_connection_reset<S: AsRawSocket>(socket: &S) -> io::Result<()> {
|
||||
let handle = socket.as_raw_socket() as SOCKET;
|
||||
|
||||
@@ -132,13 +130,14 @@ pub fn set_ip_unicast_if<S: AsRawSocket>(
|
||||
pub fn setup_socket_for_win<S: AsRawSocket>(
|
||||
socket: &S,
|
||||
bind_addr: &SocketAddr,
|
||||
bind_dev: Option<String>,
|
||||
is_udp: bool,
|
||||
) -> io::Result<()> {
|
||||
if is_udp {
|
||||
disable_connection_reset(socket)?;
|
||||
}
|
||||
|
||||
if let Some(iface) = get_interface_name_by_ip(&bind_addr.ip()) {
|
||||
if let Some(iface) = bind_dev {
|
||||
set_ip_unicast_if(socket, bind_addr, iface.as_str())?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user