tailscale/wgengine
Josh Bleecher Snyder 69cdc30c6d wgengine/wgcfg: remove Config.ListenPort
We don't use the port that wireguard-go passes to us (via magicsock.connBind.Open).
We ignore it entirely and use the port we selected.

When we tell wireguard-go that we're changing the listen_port,
it calls connBind.Close and then connBind.Open.
And in the meantime, it stops calling the receive functions,
which means that we stop receiving and processing UDP and DERP packets.
And that is Very Bad.

That was never a problem prior to b3ceca1dd7,
because we passed the SkipBindUpdate flag to our wireguard-go fork,
which told wireguard-go not to re-bind on listen_port changes.
That commit eliminated the SkipBindUpdate flag.

We could write a bunch of code to work around the gap.
We could add background readers that process UDP and DERP packets when wireguard-go isn't.
But it's simpler to never create the conditions in which wireguard-go rebinds.

The other scenario in which wireguard-go re-binds is device.Down.
Conveniently, we never call device.Down. We go from device.Up to device.Close,
and the latter only when we're shutting down a magicsock.Conn completely.

Rubber-ducked-by: Avery Pennarun <apenwarr@tailscale.com>
Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
2021-04-03 10:32:51 -07:00
..
filter net/packet, wgengine/{filter,tstun}: add TSMP ping 2021-03-24 09:50:01 -07:00
magicsock wgengine/wgcfg: remove Config.ListenPort 2021-04-03 10:32:51 -07:00
monitor wgengine/monitor: Linux fall back to polling 2021-04-01 07:29:11 -07:00
netstack wgengine/netstack: stop re-adding IPs registered by active TCP connections (#1629) 2021-03-31 15:32:33 -04:00
router wgengine/router: add a CallbackRouter shim. 2021-04-02 18:43:24 -07:00
wgcfg wgengine/wgcfg: remove Config.ListenPort 2021-04-03 10:32:51 -07:00
wglog wgengine/wglog: drop 1/s "interface is up" messages. 2021-02-23 09:01:58 -08:00
winnet wgengine/winnet: don't build on non-windows 2021-02-09 21:09:24 -08:00
pendopen.go net/tstun: rename TUN to Wrapper. 2021-03-26 23:15:22 -07:00
userspace_test.go wgengine: take in dns.Config, split out to resolver.Config and dns.OSConfig. 2021-04-02 00:59:44 -07:00
userspace.go wgengine/...: split into multiple receive functions 2021-04-02 12:18:54 -07:00
watchdog_test.go wgengine: extend TestWatchdog timeout on macOS 2021-03-27 09:27:11 -07:00
watchdog.go wgengine: take in dns.Config, split out to resolver.Config and dns.OSConfig. 2021-04-02 00:59:44 -07:00
wgengine.go wgengine: take in dns.Config, split out to resolver.Config and dns.OSConfig. 2021-04-02 00:59:44 -07:00