tailscale/wgengine/magicsock
Avery Pennarun 0d4a0bf60e magicsock: if STUN failed to send before, rebind before STUNning again.
On iOS (and possibly other platforms), sometimes our UDP socket would
get stuck in a state where it was bound to an invalid interface (or no
interface) after a network reconfiguration. We can detect this by
actually checking the error codes from sending our STUN packets.

If we completely fail to send any STUN packets, we know something is
very broken. So on the next STUN attempt, let's rebind the UDP socket
to try to correct any problems.

This fixes a problem where iOS would sometimes get stuck using DERP
instead of direct connections until the backend was restarted.

Fixes #2994

Signed-off-by: Avery Pennarun <apenwarr@tailscale.com>
2021-10-08 02:17:09 +09:00
..
debugknobs.go wgengine/magicsock: remove unused debug knob. 2021-09-01 15:13:21 -07:00
debugknobs_ios.go wgengine/magicsock: remove unused debug knob. 2021-09-01 15:13:21 -07:00
discopingpurpose_string.go wgengine/magicsock: make discoPingPurpose a stringer 2020-09-14 14:29:28 -07:00
magicsock.go magicsock: if STUN failed to send before, rebind before STUNning again. 2021-10-08 02:17:09 +09:00
magicsock_test.go wgengine/magicsock: update discokeys on netmap change. 2021-10-06 14:52:47 -07:00