tailscale/wgengine/tstun
Brad Fitzpatrick 16a9cfe2f4 wgengine: configure wireguard peers lazily, as needed
wireguard-go uses 3 goroutines per peer (with reasonably large stacks
& buffers).

Rather than tell wireguard-go about all our peers, only tell it about
peers we're actively communicating with. That means we need hooks into
magicsock's packet receiving path and tstun's packet sending path to
lazily create a wireguard peer on demand from the network map.

This frees up lots of memory for iOS (where we have almost nothing
left for larger domains with many users).

We should ideally do this in wireguard-go itself one day, but that'd
be a pretty big change.

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
2020-07-24 12:50:15 -07:00
..
faketun.go wgengine/tstun: add tests and benchmarks (#436) 2020-06-05 11:19:03 -04:00
tun.go wgengine: configure wireguard peers lazily, as needed 2020-07-24 12:50:15 -07:00
tun_test.go all: fix vet warnings 2020-07-16 08:39:38 -07:00