tailscale/wgengine/magicsock
Andrew Dunham 80b138f0df wgengine/magicsock: keep advertising endpoints after we stop discovering them
Previously, when updating endpoints we would immediately stop
advertising any endpoint that wasn't discovered during
determineEndpoints. This could result in, for example, a case where we
performed an incremental netcheck, didn't get any of our three STUN
packets back, and then dropped our STUN endpoint from the set of
advertised endpoints... which would result in clients falling back to a
DERP connection until the next call to determineEndpoints.

Instead, let's cache endpoints that we've discovered and continue
reporting them to clients until a timeout expires. In the above case
where we temporarily don't have a discovered STUN endpoint, we would
continue reporting the old value, then re-discover the STUN endpoint
again and continue reporting it as normal, so clients never see a
withdrawal.

Updates tailscale/coral#108

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: I42de72e7418ab328a6c732bdefc74549708cf8b9
2023-04-17 11:26:02 -04:00
..
debughttp.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
debugknobs_stubs.go derp,magicsock: add debug envknobs for HTTP and derp server name (#7744) 2023-04-04 17:10:50 -07:00
debugknobs.go derp,magicsock: add debug envknobs for HTTP and derp server name (#7744) 2023-04-04 17:10:50 -07:00
discopingpurpose_string.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
magicsock_default.go net/neterror, wgengine/magicsock: use UDP GSO and GRO on Linux (#7791) 2023-04-04 16:32:16 -07:00
magicsock_linux.go net/neterror, wgengine/magicsock: use UDP GSO and GRO on Linux (#7791) 2023-04-04 16:32:16 -07:00
magicsock_test.go wgengine/magicsock: keep advertising endpoints after we stop discovering them 2023-04-17 11:26:02 -04:00
magicsock_unix_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
magicsock.go wgengine/magicsock: keep advertising endpoints after we stop discovering them 2023-04-17 11:26:02 -04:00
pathfinder.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00