diff --git a/crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs b/crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs index f4c3fbbceeaa..b08ad3ac4c6f 100644 --- a/crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs +++ b/crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs @@ -13,9 +13,9 @@ use nix::ioctl_readwrite; use once_cell::sync::Lazy; use socket2::{Protocol, SockAddr}; -use super::pfvar::{in6_addr, in_addr, pfioc_natlook, pfioc_states, sockaddr_in, sockaddr_in6, PF_OUT}; +use super::pfvar::{in6_addr, in_addr, pfioc_natlook, sockaddr_in, sockaddr_in6, PF_OUT}; #[cfg(any(target_os = "macos", target_os = "ios"))] -use super::pfvar::{pf_addr, pfsync_state}; +use super::pfvar::{pf_addr, pfioc_states, pfsync_state}; ioctl_readwrite!(ioc_natlook, 'D', 23, pfioc_natlook); #[cfg(any(target_os = "macos", target_os = "ios"))] diff --git a/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/bsd.rs b/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/bsd.rs index aae4f58f7c5c..a7932561ca87 100644 --- a/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/bsd.rs +++ b/crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/bsd.rs @@ -77,8 +77,10 @@ impl UdpRedirSocket { if is_dual_stack_addr(&addr) { // set IP_ORIGDSTADDR before bind() - set_ip_origdstaddr(libc::IPPROTO_IP, &socket)?; - set_disable_ip_fragmentation(libc::IPPROTO_IP, &socket)?; + // NOTE: FreeBSD doesn't allow setting IPPROTO_IP level on an IPv6 socket + // + // set_ip_origdstaddr(libc::IPPROTO_IP, &socket)?; + // set_disable_ip_fragmentation(libc::IPPROTO_IP, &socket)?; match set_ipv6_only(&socket, false) { Ok(..) => {