From 07b2b38bc09677817f3f6f989c856836f1b0249f Mon Sep 17 00:00:00 2001 From: zonyitoo Date: Wed, 18 Oct 2023 01:17:17 +0800 Subject: [PATCH] chore(local): local-redir build warning fixed on Windows --- .../src/local/redir/sys/mod.rs | 26 +++++++++---------- .../src/local/redir/udprelay/mod.rs | 1 + 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/crates/shadowsocks-service/src/local/redir/sys/mod.rs b/crates/shadowsocks-service/src/local/redir/sys/mod.rs index 7cb39d74af3b..15c6c7efe4c6 100644 --- a/crates/shadowsocks-service/src/local/redir/sys/mod.rs +++ b/crates/shadowsocks-service/src/local/redir/sys/mod.rs @@ -24,16 +24,16 @@ where result } -#[cfg(windows)] -pub fn set_ipv6_only(socket: &S, ipv6_only: bool) -> io::Result<()> -where - S: std::os::windows::io::AsRawSocket, -{ - use std::os::windows::io::{FromRawSocket, IntoRawSocket}; - - let handle = socket.as_raw_socket(); - let sock = unsafe { Socket::from_raw_socket(handle) }; - let result = sock.set_only_v6(ipv6_only); - sock.into_raw_socket(); - result -} +// #[cfg(windows)] +// pub fn set_ipv6_only(socket: &S, ipv6_only: bool) -> io::Result<()> +// where +// S: std::os::windows::io::AsRawSocket, +// { +// use std::os::windows::io::{FromRawSocket, IntoRawSocket}; +// +// let handle = socket.as_raw_socket(); +// let sock = unsafe { Socket::from_raw_socket(handle) }; +// let result = sock.set_only_v6(ipv6_only); +// sock.into_raw_socket(); +// result +// } diff --git a/crates/shadowsocks-service/src/local/redir/udprelay/mod.rs b/crates/shadowsocks-service/src/local/redir/udprelay/mod.rs index 721315b290a8..0cb931920684 100644 --- a/crates/shadowsocks-service/src/local/redir/udprelay/mod.rs +++ b/crates/shadowsocks-service/src/local/redir/udprelay/mod.rs @@ -101,6 +101,7 @@ impl UdpInboundWrite for UdpRedirInboundWriter { // then we should always use IPv6 sockets for sending IPv4 packets. static SUPPORT_IPV6_TRANSPARENT: AtomicBool = AtomicBool::new(true); + #[allow(unused_mut)] let mut addr = match *remote_addr { Address::SocketAddress(sa) => { if SUPPORT_IPV6_TRANSPARENT.load(Ordering::Relaxed) {