Skip to content

Commit 95a5d94

Browse files
committed
Merge tag 'v1.82.5' into sunos-1.82
Release 1.82.5
2 parents 17c28e0 + e4d64c6 commit 95a5d94

File tree

7 files changed

+51
-27
lines changed

7 files changed

+51
-27
lines changed

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.82.0
1+
1.82.5

go.toolchain.rev

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4fdaeeb8fe43bcdb4e8cc736433b9cd9c0ddd221
1+
982da8f24fa0504f2214f24b0d68b2febd5983f8

ipn/desktop/mksyscall.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ package desktop
1111
//sys registerClassEx(windowClass *_WNDCLASSEX) (atom uint16, err error) [atom==0] = user32.RegisterClassExW
1212
//sys createWindowEx(dwExStyle uint32, lpClassName *uint16, lpWindowName *uint16, dwStyle uint32, x int32, y int32, nWidth int32, nHeight int32, hWndParent windows.HWND, hMenu windows.Handle, hInstance windows.Handle, lpParam unsafe.Pointer) (hWnd windows.HWND, err error) [hWnd==0] = user32.CreateWindowExW
1313
//sys defWindowProc(hwnd windows.HWND, msg uint32, wparam uintptr, lparam uintptr) (res uintptr) = user32.DefWindowProcW
14-
//sys setWindowLongPtr(hwnd windows.HWND, index int32, newLong uintptr) (res uintptr, err error) [res==0 && e1!=0] = user32.SetWindowLongPtrW
15-
//sys getWindowLongPtr(hwnd windows.HWND, index int32) (res uintptr, err error) [res==0 && e1!=0] = user32.GetWindowLongPtrW
1614
//sys sendMessage(hwnd windows.HWND, msg uint32, wparam uintptr, lparam uintptr) (res uintptr) = user32.SendMessageW
1715
//sys getMessage(lpMsg *_MSG, hwnd windows.HWND, msgMin uint32, msgMax uint32) (ret int32) = user32.GetMessageW
1816
//sys translateMessage(lpMsg *_MSG) (res bool) = user32.TranslateMessage

ipn/desktop/sessions_windows.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,3 +670,38 @@ func (cs _WTS_CONNECTSTATE_CLASS) ToSessionStatus() SessionStatus {
670670
return ClosedSession
671671
}
672672
}
673+
674+
var (
675+
procGetWindowLongPtrW *windows.LazyProc
676+
procSetWindowLongPtrW *windows.LazyProc
677+
)
678+
679+
func init() {
680+
// GetWindowLongPtrW and SetWindowLongPtrW are only available on 64-bit platforms.
681+
// https://web.archive.org/web/20250414195520/https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowlongptrw
682+
if runtime.GOARCH == "386" || runtime.GOARCH == "arm" {
683+
procGetWindowLongPtrW = moduser32.NewProc("GetWindowLongW")
684+
procSetWindowLongPtrW = moduser32.NewProc("SetWindowLongW")
685+
} else {
686+
procGetWindowLongPtrW = moduser32.NewProc("GetWindowLongPtrW")
687+
procSetWindowLongPtrW = moduser32.NewProc("SetWindowLongPtrW")
688+
}
689+
}
690+
691+
func getWindowLongPtr(hwnd windows.HWND, index int32) (res uintptr, err error) {
692+
r0, _, e1 := syscall.Syscall(procGetWindowLongPtrW.Addr(), 2, uintptr(hwnd), uintptr(index), 0)
693+
res = uintptr(r0)
694+
if res == 0 && e1 != 0 {
695+
err = errnoErr(e1)
696+
}
697+
return
698+
}
699+
700+
func setWindowLongPtr(hwnd windows.HWND, index int32, newLong uintptr) (res uintptr, err error) {
701+
r0, _, e1 := syscall.Syscall(procSetWindowLongPtrW.Addr(), 3, uintptr(hwnd), uintptr(index), uintptr(newLong))
702+
res = uintptr(r0)
703+
if res == 0 && e1 != 0 {
704+
err = errnoErr(e1)
705+
}
706+
return
707+
}

ipn/desktop/zsyscall_windows.go

Lines changed: 0 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wgengine/netstack/netstack.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,10 +326,15 @@ func Create(logf logger.Logf, tundev *tstun.Wrapper, e wgengine.Engine, mc *magi
326326
if tcpipErr != nil {
327327
return nil, fmt.Errorf("could not disable TCP RACK: %v", tcpipErr)
328328
}
329-
cubicOpt := tcpip.CongestionControlOption("cubic")
330-
tcpipErr = ipstack.SetTransportProtocolOption(tcp.ProtocolNumber, &cubicOpt)
329+
// gVisor defaults to reno at the time of writing. We explicitly set reno
330+
// congestion control in order to prevent unexpected changes. Netstack
331+
// has an int overflow in sender congestion window arithmetic that is more
332+
// prone to trigger with cubic congestion control.
333+
// See https://github.com/google/gvisor/issues/11632
334+
renoOpt := tcpip.CongestionControlOption("reno")
335+
tcpipErr = ipstack.SetTransportProtocolOption(tcp.ProtocolNumber, &renoOpt)
331336
if tcpipErr != nil {
332-
return nil, fmt.Errorf("could not set cubic congestion control: %v", tcpipErr)
337+
return nil, fmt.Errorf("could not set reno congestion control: %v", tcpipErr)
333338
}
334339
err := setTCPBufSizes(ipstack)
335340
if err != nil {

wgengine/userspace.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1580,6 +1580,12 @@ type fwdDNSLinkSelector struct {
15801580
}
15811581

15821582
func (ls fwdDNSLinkSelector) PickLink(ip netip.Addr) (linkName string) {
1583+
// sandboxed macOS does not automatically bind to the loopback interface so
1584+
// we must be explicit about it.
1585+
if runtime.GOOS == "darwin" && ip.IsLoopback() {
1586+
return "lo0"
1587+
}
1588+
15831589
if ls.ue.isDNSIPOverTailscale.Load()(ip) {
15841590
return ls.tunName
15851591
}

0 commit comments

Comments
 (0)