Skip to content

Commit d664ba0

Browse files
committed
Update WireGuard and Tailscale
1 parent e9dbe69 commit d664ba0

File tree

10 files changed

+70
-99
lines changed

10 files changed

+70
-99
lines changed
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
#!/usr/bin/env bash
22

3-
VERSION="1.23.12"
3+
VERSION="1.25.1"
44

55
mkdir -p $HOME/go
66
cd $HOME/go
77
wget "https://dl.google.com/go/go${VERSION}.linux-amd64.tar.gz"
88
tar -xzf "go${VERSION}.linux-amd64.tar.gz"
9-
mv go go_legacy
10-
cd go_legacy
9+
mv go go_win7
10+
cd go_win7
1111

1212
# modify from https://github.com/restic/restic/issues/4636#issuecomment-1896455557
13-
# this patch file only works on golang1.23.x
14-
# that means after golang1.24 release it must be changed
15-
# see: https://github.com/MetaCubeX/go/commits/release-branch.go1.23/
13+
# this patch file only works on golang1.25.x
14+
# that means after golang1.26 release it must be changed
15+
# see: https://github.com/MetaCubeX/go/commits/release-branch.go1.25/
1616
# revert:
1717
# 693def151adff1af707d82d28f55dba81ceb08e1: "crypto/rand,runtime: switch RtlGenRandom for ProcessPrng"
1818
# 7c1157f9544922e96945196b47b95664b1e39108: "net: remove sysSocket fallback for Windows 7"
1919
# 48042aa09c2f878c4faa576948b07fe625c4707a: "syscall: remove Windows 7 console handle workaround"
2020
# a17d959debdb04cd550016a3501dd09d50cd62e7: "runtime: always use LoadLibraryEx to load system libraries"
2121

22-
curl https://github.com/MetaCubeX/go/commit/9ac42137ef6730e8b7daca016ece831297a1d75b.diff | patch --verbose -p 1
23-
curl https://github.com/MetaCubeX/go/commit/21290de8a4c91408de7c2b5b68757b1e90af49dd.diff | patch --verbose -p 1
24-
curl https://github.com/MetaCubeX/go/commit/6a31d3fa8e47ddabc10bd97bff10d9a85f4cfb76.diff | patch --verbose -p 1
25-
curl https://github.com/MetaCubeX/go/commit/69e2eed6dd0f6d815ebf15797761c13f31213dd6.diff | patch --verbose -p 1
22+
alias curl='curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"'
23+
24+
curl https://github.com/MetaCubeX/go/commit/8cb5472d94c34b88733a81091bd328e70ee565a4.diff | patch --verbose -p 1
25+
curl https://github.com/MetaCubeX/go/commit/6788c4c6f9fafb56729bad6b660f7ee2272d699f.diff | patch --verbose -p 1
26+
curl https://github.com/MetaCubeX/go/commit/a5b2168bb836ed9d6601c626f95e56c07923f906.diff | patch --verbose -p 1
27+
curl https://github.com/MetaCubeX/go/commit/f56f1e23507e646c85243a71bde7b9629b2f970c.diff | patch --verbose -p 1

.github/workflows/build.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ jobs:
8888
- { os: linux, arch: loong64, debian: loongarch64, rpm: loongarch64, openwrt: "loongarch64_generic" }
8989

9090
- { os: windows, arch: amd64 }
91-
- { os: windows, arch: amd64, legacy_go123: true, legacy_name: "windows-7" }
91+
- { os: windows, arch: amd64, legacy_win7: true, legacy_name: "windows-7" }
9292
- { os: windows, arch: "386" }
93-
- { os: windows, arch: "386", legacy_go123: true, legacy_name: "windows-7" }
93+
- { os: windows, arch: "386", legacy_win7: true, legacy_name: "windows-7" }
9494
- { os: windows, arch: arm64 }
9595

9696
- { os: darwin, arch: amd64 }
@@ -116,23 +116,23 @@ jobs:
116116
uses: actions/setup-go@v5
117117
with:
118118
go-version: ~1.24.6
119-
- name: Cache Go 1.23
120-
if: matrix.legacy_go123
121-
id: cache-legacy-go
119+
- name: Cache Go for Windows 7
120+
if: matrix.legacy_win7
121+
id: cache-go-for-windows7
122122
uses: actions/cache@v4
123123
with:
124124
path: |
125-
~/go/go_legacy
126-
key: go_legacy_12312
127-
- name: Setup Go 1.23
128-
if: matrix.legacy_go123 && steps.cache-legacy-go.outputs.cache-hit != 'true'
125+
~/go/go_win7
126+
key: go_win7_1251
127+
- name: Setup Go for Windows 7
128+
if: matrix.legacy_win7 && steps.cache-go-for-windows7.outputs.cache-hit != 'true'
129129
run: |-
130-
.github/setup_legacy_go.sh
131-
- name: Setup Go 1.23
132-
if: matrix.legacy_go123
130+
.github/setup_go_for_windows7.sh
131+
- name: Setup Go for Windows 7
132+
if: matrix.legacy_win7
133133
run: |-
134-
echo "PATH=$HOME/go/go_legacy/bin:$PATH" >> $GITHUB_ENV
135-
echo "GOROOT=$HOME/go/go_legacy" >> $GITHUB_ENV
134+
echo "PATH=$HOME/go/go_win7/bin:$PATH" >> $GITHUB_ENV
135+
echo "GOROOT=$HOME/go/go_win7" >> $GITHUB_ENV
136136
- name: Setup Android NDK
137137
if: matrix.os == 'android'
138138
uses: nttld/setup-ndk@v1

common/dialer/default.go

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -356,18 +356,8 @@ func (d *DefaultDialer) ListenSerialInterfacePacket(ctx context.Context, destina
356356
return trackPacketConn(packetConn, nil)
357357
}
358358

359-
func (d *DefaultDialer) ListenPacketCompat(network, address string) (net.PacketConn, error) {
360-
udpListener := d.udpListener
361-
udpListener.Control = control.Append(udpListener.Control, func(network, address string, conn syscall.RawConn) error {
362-
for _, wgControlFn := range WgControlFns {
363-
err := wgControlFn(network, address, conn)
364-
if err != nil {
365-
return err
366-
}
367-
}
368-
return nil
369-
})
370-
return udpListener.ListenPacket(context.Background(), network, address)
359+
func (d *DefaultDialer) WireGuardControl() control.Func {
360+
return d.udpListener.Control
371361
}
372362

373363
func trackConn(conn net.Conn, err error) (net.Conn, error) {

common/dialer/wireguard.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
package dialer
22

33
import (
4-
"net"
5-
64
"github.com/sagernet/sing/common/control"
75
)
86

97
type WireGuardListener interface {
10-
ListenPacketCompat(network, address string) (net.PacketConn, error)
8+
WireGuardControl() control.Func
119
}
12-
13-
var WgControlFns []control.Func

go.mod

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/sagernet/sing-box
22

3-
go 1.23.1
3+
go 1.24.6
44

55
require (
66
github.com/anytls/sing-anytls v0.0.8
@@ -36,8 +36,8 @@ require (
3636
github.com/sagernet/sing-tun v0.8.0-beta.8.0.20250911105100-0381a06643bc
3737
github.com/sagernet/sing-vmess v0.2.8-0.20250909125414-3aed155119a1
3838
github.com/sagernet/smux v1.5.34-mod.2
39-
github.com/sagernet/tailscale v1.80.3-sing-box-1.13-mod.1
40-
github.com/sagernet/wireguard-go v0.0.1-beta.7
39+
github.com/sagernet/tailscale v1.86.5-sing-box-1.13-mod.2
40+
github.com/sagernet/wireguard-go v0.0.2-beta.1
4141
github.com/sagernet/ws v0.0.0-20231204124109-acfe8907c854
4242
github.com/spf13/cobra v1.9.1
4343
github.com/stretchr/testify v1.11.1
@@ -63,7 +63,6 @@ require (
6363
github.com/akutz/memconn v0.1.0 // indirect
6464
github.com/alexbrainman/sspi v0.0.0-20231016080023-1a75b4708caa // indirect
6565
github.com/andybalholm/brotli v1.1.0 // indirect
66-
github.com/bits-and-blooms/bitset v1.13.0 // indirect
6766
github.com/caddyserver/zerossl v0.1.3 // indirect
6867
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
6968
github.com/coreos/go-iptables v0.7.1-0.20240112124308-65c67c9f46e6 // indirect
@@ -73,8 +72,8 @@ require (
7372
github.com/digitalocean/go-smbios v0.0.0-20180907143718-390a4f403a8e // indirect
7473
github.com/fsnotify/fsnotify v1.7.0 // indirect
7574
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
76-
github.com/gaissmai/bart v0.11.1 // indirect
77-
github.com/go-json-experiment/json v0.0.0-20250103232110-6a9a0fde9288 // indirect
75+
github.com/gaissmai/bart v0.18.0 // indirect
76+
github.com/go-json-experiment/json v0.0.0-20250223041408-d3c622f1b874 // indirect
7877
github.com/go-ole/go-ole v1.3.0 // indirect
7978
github.com/gobwas/httphead v0.1.0 // indirect
8079
github.com/gobwas/pool v0.2.1 // indirect
@@ -84,16 +83,13 @@ require (
8483
github.com/google/go-querystring v1.1.0 // indirect
8584
github.com/google/nftables v0.2.1-0.20240414091927-5e242ec57806 // indirect
8685
github.com/google/uuid v1.6.0 // indirect
87-
github.com/gorilla/csrf v1.7.3-0.20250123201450-9dd6af1f6d30 // indirect
88-
github.com/gorilla/securecookie v1.1.2 // indirect
8986
github.com/hashicorp/yamux v0.1.2 // indirect
9087
github.com/hdevalence/ed25519consensus v0.2.0 // indirect
91-
github.com/illarion/gonotify/v2 v2.0.3 // indirect
88+
github.com/illarion/gonotify/v3 v3.0.2 // indirect
9289
github.com/inconshreveable/mousetrap v1.1.0 // indirect
9390
github.com/jsimonetti/rtnetlink v1.4.0 // indirect
9491
github.com/klauspost/compress v1.17.11 // indirect
9592
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
96-
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect
9793
github.com/libdns/libdns v1.1.0 // indirect
9894
github.com/mdlayher/genetlink v1.3.2 // indirect
9995
github.com/mdlayher/netlink v1.7.3-0.20250113171957-fbb4dce95f42 // indirect
@@ -110,12 +106,12 @@ require (
110106
github.com/spf13/pflag v1.0.6 // indirect
111107
github.com/tailscale/certstore v0.1.1-0.20231202035212-d3fa0460f47e // indirect
112108
github.com/tailscale/go-winio v0.0.0-20231025203758-c4f33415bf55 // indirect
113-
github.com/tailscale/golang-x-crypto v0.0.0-20240604161659-3fde5e568aa4 // indirect
114109
github.com/tailscale/goupnp v1.0.1-0.20210804011211-c64d0f06ea05 // indirect
115110
github.com/tailscale/hujson v0.0.0-20221223112325-20486734a56a // indirect
116111
github.com/tailscale/netlink v1.1.1-0.20240822203006-4d49adab4de7 // indirect
117112
github.com/tailscale/peercred v0.0.0-20250107143737-35a0c7bd7edc // indirect
118113
github.com/tailscale/web-client-prebuilt v0.0.0-20250124233751-d4cd19a26976 // indirect
114+
github.com/tailscale/wireguard-go v0.0.0-20250716170648-1d0488a3d7da // indirect
119115
github.com/u-root/uio v0.0.0-20240224005618-d2acac8f3701 // indirect
120116
github.com/x448/float16 v0.8.4 // indirect
121117
github.com/zeebo/blake3 v0.2.4 // indirect
@@ -125,7 +121,7 @@ require (
125121
golang.org/x/sync v0.16.0 // indirect
126122
golang.org/x/term v0.34.0 // indirect
127123
golang.org/x/text v0.28.0 // indirect
128-
golang.org/x/time v0.9.0 // indirect
124+
golang.org/x/time v0.11.0 // indirect
129125
golang.org/x/tools v0.36.0 // indirect
130126
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
131127
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect

0 commit comments

Comments
 (0)