Skip to content

Commit

Permalink
chore(server): add more log about EAFNOSUPPORT
Browse files Browse the repository at this point in the history
  • Loading branch information
zonyitoo committed Jun 16, 2024
1 parent 56cab5a commit 885fdf2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/shadowsocks-service/src/local/redir/udprelay/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl UdpInboundWrite for UdpRedirInboundWriter {
ErrorKind::InvalidInput if addr_mapped_ipv6 => {
SUPPORT_IPV6_TRANSPARENT.store(false, Ordering::Relaxed);
debug!(
"redir destination socket doesn't support IPv6, addr cannot be IPv4-mapped-IPv6: {}",
"redir destination socket doesn't support dual-stack routing, addr cannot be IPv4-mapped-IPv6: {}",
addr
);
}
Expand Down
7 changes: 3 additions & 4 deletions crates/shadowsocks-service/src/server/udprelay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ use tokio::{runtime::Handle, sync::mpsc, task::JoinHandle, time};
use windows_sys::Win32::Networking::WinSock::WSAEAFNOSUPPORT;

use crate::net::{
packet_window::PacketWindowFilter,
utils::to_ipv4_mapped,
MonProxySocket,
UDP_ASSOCIATION_KEEP_ALIVE_CHANNEL_SIZE,
packet_window::PacketWindowFilter, utils::to_ipv4_mapped, MonProxySocket, UDP_ASSOCIATION_KEEP_ALIVE_CHANNEL_SIZE,
UDP_ASSOCIATION_SEND_CHANNEL_SIZE,
};

Expand Down Expand Up @@ -704,11 +701,13 @@ impl UdpAssociationContext {
#[cfg(unix)]
Some(libc::EAFNOSUPPORT) => {
UDP_SOCKET_SUPPORT_DUAL_STACK.store(false, Ordering::Relaxed);
debug!("udp relay destination {} cannot be IPv4-mapped-IPv6, current platform doesn't support IPv6", target_addr);
continue;
}
#[cfg(windows)]
Some(WSAEAFNOSUPPORT) => {
UDP_SOCKET_SUPPORT_DUAL_STACK.store(false, Ordering::Relaxed);
debug!("udp relay destination {} cannot be IPv4-mapped-IPv6, current platform doesn't support IPv6", target_addr);
continue;
}
_ => return Err(err),
Expand Down

0 comments on commit 885fdf2

Please sign in to comment.