wgengine/magicsock: don't mutexly reach inside Conn to tweak DERP settings.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-03-06 16:20:05 -08:00
committed by Dave Anderson
parent f6dd2128d9
commit fdee5fb639
2 changed files with 5 additions and 8 deletions

View File

@ -124,6 +124,8 @@ type Options struct {
// EndpointsFunc optionally provides a func to be called when
// endpoints change. The called func does not own the slice.
EndpointsFunc func(endpoint []string)
derpTLSConfig *tls.Config // normally nil; used by tests
}
func (o *Options) endpointsFunc() func([]string) {
@ -173,6 +175,7 @@ func Listen(opts Options) (*Conn, error) {
wantDerp: true,
derpRecvCh: make(chan derpReadResult),
udpRecvCh: make(chan udpReadResult),
derpTLSConfig: opts.derpTLSConfig,
}
c.ignoreSTUNPackets()
c.pconn.Reset(packetConn.(*net.UDPConn))