You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tailscale/wgengine/magicsock
Andrew Dunham e107977f75 wgengine/magicsock: disable SIO_UDP_NETRESET on Windows
By default, Windows sets the SIO_UDP_CONNRESET and SIO_UDP_NETRESET
options on created UDP sockets. These behaviours make the UDP socket
ICMP-aware; when the system gets an ICMP message (e.g. an "ICMP Port
Unreachable" message, in the case of SIO_UDP_CONNRESET), it will cause
the underlying UDP socket to throw an error. Confusingly, this can occur
even on reads, if the same UDP socket is used to write a packet that
triggers this response.

The Go runtime disabled the SIO_UDP_CONNRESET behavior in 3114bd6, but
did not change SIO_UDP_NETRESET–probably because that socket option
isn't documented particularly well.

Various other networking code seem to disable this behaviour, such as
the Godot game engine (godotengine/godot#22332) and the Eclipse TCF
agent (link below). Others appear to work around this by ignoring the
error returned (anacrolix/dht#16, among others).

For now, until it's clear whether this ends up in the upstream Go
implementation or not, let's also disable the SIO_UDP_NETRESET in a
similar manner to SIO_UDP_CONNRESET.

Eclipse TCF agent: https://gitlab.eclipse.org/eclipse/tcf/tcf.agent/-/blob/master/agent/tcf/framework/mdep.c

Updates #10976
Updates golang/go#68614

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I70a2f19855f8dec1bfb82e63f6d14fc4a22ed5c3
3 months ago
..
batching_conn.go wgengine/magicsock: refactor batchingUDPConn to batchingConn interface (#13042) 4 months ago
batching_conn_default.go wgengine/magicsock: refactor batchingUDPConn to batchingConn interface (#13042) 4 months ago
batching_conn_linux.go wgengine/magicsock: refactor batchingUDPConn to batchingConn interface (#13042) 4 months ago
batching_conn_linux_test.go wgengine/magicsock: refactor batchingUDPConn to batchingConn interface (#13042) 4 months ago
blockforever_conn.go wgengine/magicsock: improve don't fragment bit set/get support 1 year ago
cloudinfo.go wgengine/magicsock: use cloud metadata to get public IPs 4 months ago
cloudinfo_nocloud.go wgengine/magicsock: use cloud metadata to get public IPs 4 months ago
cloudinfo_test.go wgengine/magicsock: use cloud metadata to get public IPs 4 months ago
debughttp.go all: remove LenIter, use Go 1.22 range-over-int instead 9 months ago
debugknobs.go wgengine/magicsock: allow a CSV list for pretendpoint 4 months ago
debugknobs_stubs.go wgengine/magicsock: allow a CSV list for pretendpoint 4 months ago
derp.go control/controlknobs,tailcfg,wgengine/magicsock: remove DRPO shutoff switch 5 months ago
derp_test.go net/netcheck,wgengine/magicsock: align DERP frame receive time heuristics 8 months ago
discopingpurpose_string.go wgengine/magicsock: implement probing of UDP path lifetime (#10844) 10 months ago
endpoint.go all: use math/rand/v2 more 6 months ago
endpoint_default.go all: adjust some build tags for plan9 1 year ago
endpoint_stub.go all: adjust some build tags for plan9 1 year ago
endpoint_test.go wgengine/magicsock: implement probing of UDP path lifetime (#10844) 10 months ago
endpoint_tracker.go wgengine/magicsock: only cache N most recent endpoints per-Addr 1 year ago
endpoint_tracker_test.go all: use Go 1.22 range-over-int 7 months ago
magicsock.go wgengine/magicsock: disable SIO_UDP_NETRESET on Windows 3 months ago
magicsock_default.go wgengine/magicsock: refactor batchingUDPConn to batchingConn interface (#13042) 4 months ago
magicsock_linux.go cmd/tta, vnet: add host firewall, env var support, more tests 3 months ago
magicsock_notwindows.go wgengine/magicsock: disable SIO_UDP_NETRESET on Windows 3 months ago
magicsock_test.go wgengine/magicsock: refactor batchingUDPConn to batchingConn interface (#13042) 4 months ago
magicsock_unix_test.go all: update copyright and license headers 2 years ago
magicsock_windows.go wgengine/magicsock: disable SIO_UDP_NETRESET on Windows 3 months ago
peermap.go wgengine/magicsock: allow disco communication without known endpoints 7 months ago
peermtu.go magicsock: mute noisy expected peer mtu related error (#10870) 10 months ago
peermtu_darwin.go wgengine/magicsock: improve don't fragment bit set/get support 1 year ago
peermtu_linux.go wgengine/magicsock: improve don't fragment bit set/get support 1 year ago
peermtu_stubs.go magicsock: mute noisy expected peer mtu related error (#10870) 10 months ago
peermtu_unix.go wgengine/magicsock: replace CanPMTUD() with ShouldPMTUD() 1 year ago
rebinding_conn.go wgengine/magicsock: refactor batchingUDPConn to batchingConn interface (#13042) 4 months ago