Skip to content

Commit

Permalink
Fix: convert size to unit32 in getoridst to solve some mips64 devices…
Browse files Browse the repository at this point in the history
… cannot get redirect origin dst (#2041)

Change-Id: I40aa73dcea692132e38db980320a8a07ed427fe6

Co-authored-by: Zhao Guowei <[email protected]>
  • Loading branch information
maomaozgw and Zhao Guowei authored Mar 28, 2022
1 parent 275cc7e commit dd9bdf4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion listener/redir/tcp_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit dd9bdf4

Please sign in to comment.