mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-05-07 18:24:36 +00:00
fix: disable SO_EXCLUSIVEADDRUSE on Windows (#2180)
This commit is contained in:
@@ -137,12 +137,13 @@ pub fn setup_socket_for_win<S: AsRawSocket>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let socket = SOCKET(socket.as_raw_socket() as usize);
|
let socket = SOCKET(socket.as_raw_socket() as usize);
|
||||||
let optval = 1_i32.to_ne_bytes();
|
|
||||||
unsafe {
|
// let optval = 1_i32.to_ne_bytes();
|
||||||
if setsockopt(socket, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, Some(&optval)) == SOCKET_ERROR {
|
// unsafe {
|
||||||
return Err(io::Error::last_os_error());
|
// if setsockopt(socket, SOL_SOCKET, SO_EXCLUSIVEADDRUSE, Some(&optval)) == SOCKET_ERROR {
|
||||||
}
|
// return Err(io::Error::last_os_error());
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if let Some(iface) = bind_dev {
|
if let Some(iface) = bind_dev {
|
||||||
set_ip_unicast_if(socket, bind_addr, &iface)?;
|
set_ip_unicast_if(socket, bind_addr, &iface)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user