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
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>
3 years ago
..
filter net/packet, wgengine/{filter,tstun}: add TSMP ping 3 years ago
magicsock wgengine/wgcfg: remove Config.ListenPort 3 years ago
monitor wgengine/monitor: Linux fall back to polling 3 years ago
netstack wgengine/netstack: stop re-adding IPs registered by active TCP connections (#1629) 3 years ago
router wgengine/router: add a CallbackRouter shim. 3 years ago
wgcfg wgengine/wgcfg: remove Config.ListenPort 3 years ago
wglog wgengine/wglog: drop 1/s "interface is up" messages. 3 years ago
winnet wgengine/winnet: don't build on non-windows 3 years ago
pendopen.go net/tstun: rename TUN to Wrapper. 3 years ago
userspace.go wgengine/...: split into multiple receive functions 3 years ago
userspace_test.go wgengine: take in dns.Config, split out to resolver.Config and dns.OSConfig. 3 years ago
watchdog.go wgengine: take in dns.Config, split out to resolver.Config and dns.OSConfig. 3 years ago
watchdog_test.go wgengine: extend TestWatchdog timeout on macOS 3 years ago
wgengine.go wgengine: take in dns.Config, split out to resolver.Config and dns.OSConfig. 3 years ago