Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PR: 271597 Reported by: Yonas Yanfa <yonas.yanfa@gmail.com>
- Loading branch information
Showing
3 changed files
with
25 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
TIMESTAMP = 1674933715 | ||
SHA256 (go/net_clash/clash-v1.12.0/v1.12.0.mod) = 5fb76465113613d05ad5c4a630847ebe66f11b24daf4c0a3b8c4a110dbed8382 | ||
SIZE (go/net_clash/clash-v1.12.0/v1.12.0.mod) = 1444 | ||
SHA256 (go/net_clash/clash-v1.12.0/v1.12.0.zip) = 6ee01ed27a5dd7877f9ce303b93b5d8e47d7c02706f063b6d8b18f78246dbda1 | ||
SIZE (go/net_clash/clash-v1.12.0/v1.12.0.zip) = 271817 | ||
TIMESTAMP = 1684915246 | ||
SHA256 (go/net_clash/clash-v1.16.0/v1.16.0.mod) = 28ce820304dbf04d92b768d784195ccd9526cf49bc2363111688cf6ea528d5b3 | ||
SIZE (go/net_clash/clash-v1.16.0/v1.16.0.mod) = 1617 | ||
SHA256 (go/net_clash/clash-v1.16.0/v1.16.0.zip) = 5cc5f78cc5192d82581464c62a0b30402df25595d2534101f288180f7c43b4c8 | ||
SIZE (go/net_clash/clash-v1.16.0/v1.16.0.zip) = 391354 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
--- listener/redir/tcp_freebsd.go.orig 2022-05-22 03:30:14 UTC | ||
--- listener/redir/tcp_freebsd.go.orig 2023-05-24 08:01:04 UTC | ||
+++ listener/redir/tcp_freebsd.go | ||
@@ -38,7 +38,8 @@ func parserPacket(conn net.Conn) (socks5.Addr, error) | ||
func getorigdst(fd uintptr) (socks5.Addr, error) { | ||
raw := syscall.RawSockaddrInet4{} | ||
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 { | ||
+ _, _, err := syscall.Syscall6(syscall.SYS_GETSOCKOPT, fd, syscall.IPPROTO_IP, SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&raw)), uintptr(unsafe.Pointer(&siz)), 0); | ||
@@ -46,7 +46,8 @@ func parserPacket(conn net.Conn) (socks5.Addr, error) | ||
func getorigdst(fd uintptr) (netip.AddrPort, error) { | ||
addr := unix.RawSockaddrInet4{} | ||
size := uint32(unsafe.Sizeof(addr)) | ||
- if err := socketcall(GETSOCKOPT, fd, syscall.IPPROTO_IP, SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&addr)), uintptr(unsafe.Pointer(&size)), 0); err != nil { | ||
+ _, _, err := syscall.Syscall6(syscall.SYS_GETSOCKOPT, fd, syscall.IPPROTO_IP, SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&addr)), uintptr(unsafe.Pointer(&size)), 0); | ||
+ if err != 0 { | ||
return nil, err | ||
return netip.AddrPort{}, err | ||
} | ||
|
||
port := binary.BigEndian.Uint16((*(*[2]byte)(unsafe.Pointer(&addr.Port)))[:]) | ||
@@ -56,7 +57,8 @@ func getorigdst(fd uintptr) (netip.AddrPort, error) { | ||
func getorigdst6(fd uintptr) (netip.AddrPort, error) { | ||
addr := unix.RawSockaddrInet6{} | ||
size := uint32(unsafe.Sizeof(addr)) | ||
- if err := socketcall(GETSOCKOPT, fd, syscall.IPPROTO_IPV6, IP6T_SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&addr)), uintptr(unsafe.Pointer(&size)), 0); err != nil { | ||
+ _, _, err := syscall.Syscall6(syscall.SYS_GETSOCKOPT, fd, syscall.IPPROTO_IPV6, IP6T_SO_ORIGINAL_DST, uintptr(unsafe.Pointer(&addr)), uintptr(unsafe.Pointer(&size)), 0); | ||
+ if err != 0 { | ||
return netip.AddrPort{}, err | ||
} | ||
port := binary.BigEndian.Uint16((*(*[2]byte)(unsafe.Pointer(&addr.Port)))[:]) |