The guard refused to start an AmneziaWG endpoint whose detour chain reached a WireGuard one, and refused silently: not an error, just started=false, after which every dial failed with "WireGuard is not ready yet". A selector hook went further and suspended an already-working node the moment its group switched to a WireGuard member. It existed because AmneziaWG inside WireGuard hung the kernel on Android. We do not ship Android, upstream dropped the guard once the cause was gone, and the cure landed here yesterday — the ClientBind reserved-gate plus the submodule pin that carries its twin. So the tree held both the cure and the prohibition on using it, and the configuration simply did not come up while looking like a node that "just does not work". Also takes the two fixes that belong with it. ClientBind.conn was read on a lock-free fast path and written under a mutex; upstream found that race with the same end-to-end test we wrote yesterday, so we had taken one half of a pair again. And the outer WireGuard UDP socket forced DF, unlike direct, hysteria and tuic — with encapsulation the datagram regularly exceeds the path MTU and the kernel drops it instead of fragmenting, a symptom indistinguishable from the bug we spent yesterday on. The race needed its own test: the existing e2e run did not flag it under -race even at -count=15. Eight goroutines over both connect branches reproduce it deterministically, naming the lock-free read and the guarded write. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
36 lines
677 B
Go
36 lines
677 B
Go
//go:build darwin
|
|
|
|
package dialer
|
|
|
|
import (
|
|
"syscall"
|
|
"testing"
|
|
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// udpSocketDFSet reports whether the socket has "don't fragment" forced on
|
|
// (control.DisableUDPFragment sets IP_DONTFRAG=1 on darwin).
|
|
func udpSocketDFSet(t *testing.T, sysConn syscall.Conn) bool {
|
|
t.Helper()
|
|
rawConn, err := sysConn.SyscallConn()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
var (
|
|
value int
|
|
sockErr error
|
|
ctrlErr error
|
|
)
|
|
ctrlErr = rawConn.Control(func(fd uintptr) {
|
|
value, sockErr = unix.GetsockoptInt(int(fd), unix.IPPROTO_IP, unix.IP_DONTFRAG)
|
|
})
|
|
if ctrlErr != nil {
|
|
t.Fatal(ctrlErr)
|
|
}
|
|
if sockErr != nil {
|
|
t.Fatal(sockErr)
|
|
}
|
|
return value != 0
|
|
}
|