From 6d7bc358c11701c7114d877cb0ab2c9e33146db9 Mon Sep 17 00:00:00 2001 From: ty Date: Tue, 25 Jun 2024 14:02:15 +0800 Subject: [PATCH] fix(local-redir): FreeBSD UDP set IP_RECVORIGDSTADDR, IPV6_RECVORIGDSTADDR NOTE: They have the same value as IP_ORIGDSTADDR, IPV6_ORIGDSTADDR ref #1543 --- .../src/local/redir/udprelay/sys/unix/bsd.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 a7932561ca87..56e21a4dbfbf 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 @@ -219,8 +219,8 @@ fn set_ip_origdstaddr(level: libc::c_int, socket: &Socket) -> io::Result<()> { let enable: libc::c_int = 1; let opt = match level { - libc::IPPROTO_IP => libc::IP_ORIGDSTADDR, - libc::IPPROTO_IPV6 => libc::IPV6_ORIGDSTADDR, + libc::IPPROTO_IP => libc::IP_RECVORIGDSTADDR, + libc::IPPROTO_IPV6 => libc::IPV6_RECVORIGDSTADDR, _ => unreachable!("level can only be IPPROTO_IP or IPPROTO_IPV6"), };