git: a8179bb67ad1 - main - net/clash: Update 1.12.0 → 1.16.0

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Wed, 24 May 2023 08:39:44 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a8179bb67ad193b93e508a19094191f980ad70e8

commit a8179bb67ad193b93e508a19094191f980ad70e8
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2023-05-24 08:08:05 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2023-05-24 08:39:40 +0000

    net/clash: Update 1.12.0 → 1.16.0
    
    PR:             271597
    Reported by:    Yonas Yanfa <yonas.yanfa@gmail.com>
---
 net/clash/Makefile                                 |  3 +--
 net/clash/distinfo                                 | 10 ++++----
 .../files/patch-listener_redir_tcp__freebsd.go     | 28 +++++++++++++++-------
 3 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/net/clash/Makefile b/net/clash/Makefile
index e308d11de325..2deb01200835 100644
--- a/net/clash/Makefile
+++ b/net/clash/Makefile
@@ -1,7 +1,6 @@
 PORTNAME=	clash
 DISTVERSIONPREFIX=	v
-DISTVERSION=	1.12.0
-PORTREVISION=	4
+DISTVERSION=	1.16.0
 CATEGORIES=	net
 
 MAINTAINER=	yuri@FreeBSD.org
diff --git a/net/clash/distinfo b/net/clash/distinfo
index b114acab1d26..826e3b0eab80 100644
--- a/net/clash/distinfo
+++ b/net/clash/distinfo
@@ -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
diff --git a/net/clash/files/patch-listener_redir_tcp__freebsd.go b/net/clash/files/patch-listener_redir_tcp__freebsd.go
index b1a770082637..7544e08723ab 100644
--- a/net/clash/files/patch-listener_redir_tcp__freebsd.go
+++ b/net/clash/files/patch-listener_redir_tcp__freebsd.go
@@ -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)))[:])