net/tsdial: also plumb TUN name and monitor into tsdial.Dialer

In prep for moving stuff out of LocalBackend.

Change-Id: I9725aa9c3ebc7275f8c40e040b326483c0340127
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-12-01 09:18:17 -08:00
committed by Brad Fitzpatrick
parent c37af58ea4
commit c7fb26acdb
8 changed files with 48 additions and 19 deletions

View File

@@ -2185,17 +2185,9 @@ func (b *LocalBackend) initPeerAPIListener() {
return
}
var tunName string
if ge, ok := b.e.(wgengine.InternalsGetter); ok {
if tunWrap, _, ok := ge.GetInternals(); ok {
tunName, _ = tunWrap.Name()
}
}
ps := &peerAPIServer{
b: b,
rootDir: fileRoot,
tunName: tunName,
selfNode: selfNode,
directFileMode: b.directFileRoot != "",
}