]> Cypherpunks repositories - gostls13.git/commit
net,internal/syscall/windows: prove that keep alive options exists
authorqmuntal <quimmuntal@gmail.com>
Fri, 8 Mar 2024 14:40:34 +0000 (15:40 +0100)
committerQuim Muntal <quimmuntal@gmail.com>
Thu, 21 Mar 2024 11:49:35 +0000 (11:49 +0000)
commit68a508cdaf3caf98b0ed3ca1bcc3046a77df1722
tree8af6d06ecf1df80c1c09eb954eb5f00cab922e0c
parentf2685395447035c8f63690e88f12ab76d100f451
net,internal/syscall/windows: prove that keep alive options exists

The net package currently uses windows.SupportFullTCPKeepAlive to
know if TCP_KEEPIDLE, TCP_KEEPINTVL, and TCP_KEEPCNT are available.
This function is a wrapper over the undocumented RtlGetNtVersionNumbers
API, which tests if the Windows version is at least 10.0.16299. This
approach artificially limits the use of TCP_KEEPCNT, which is
available since Windows 10.0.15063. It also uses an undocumented API,
which is not something we want to rely on.

This CL removes windows.SupportFullTCPKeepAlive in favor of dedicated
proves for each option which are not based on the Windows version.

While here, remove some assertions in setKeepAliveCount. It is better
to let the system decide if the value is valid or not.

Updates #65817.

Cq-Include-Trybots: luci.golang.try:gotip-windows-arm64
Change-Id: I0fe70d46c8675eab06c0e4628cf68571b6e50b80
Reviewed-on: https://go-review.googlesource.com/c/go/+/570077
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
src/internal/syscall/windows/version_windows.go
src/net/tcpconn_keepalive_conf_windows_test.go
src/net/tcpsock_windows.go
src/net/tcpsockopt_windows.go