From dd9bdf4e2f68fc77240d10ada76b5df60eb02b4d Mon Sep 17 00:00:00 2001 From: Guowei Zhao Date: Mon, 28 Mar 2022 14:48:51 +0800 Subject: [PATCH] Fix: convert size to unit32 in getoridst to solve some mips64 devices cannot get redirect origin dst (#2041) Change-Id: I40aa73dcea692132e38db980320a8a07ed427fe6 Co-authored-by: Zhao Guowei --- listener/redir/tcp_linux.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/listener/redir/tcp_linux.go b/listener/redir/tcp_linux.go index e802319c..c4a47d8e 100644 --- a/listener/redir/tcp_linux.go +++ b/listener/redir/tcp_linux.go @@ -37,7 +37,7 @@ func parserPacket(conn net.Conn) (socks5.Addr, error) { // Call getorigdst() from linux/net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c func getorigdst(fd uintptr) (socks5.Addr, error) { raw := syscall.RawSockaddrInet4{} - siz := unsafe.Sizeof(raw) + siz := uint32(unsafe.Sizeof(raw)) if err := socketcall(GETSOCKOPT, fd, syscall.IPPROTO_IP, SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&raw)), uintptr(unsafe.Pointer(&siz)), 0); err != nil { return nil, err }