summaryrefslogtreecommitdiffhomepage
path: root/control
diff options
context:
space:
mode:
authorBrad Fitzpatrick <bradfitz@tailscale.com>2020-06-19 12:06:49 -0700
committerBrad Fitzpatrick <bradfitz@tailscale.com>2020-06-19 12:12:00 -0700
commit53fb25fc2fc49deaae48e36044f80ff1eded9aa9 (patch)
tree4a4759a4b0a27c1786610198c1503e60497093e6 /control
parent88c305c8afa15dbee5a6cb8b98e5547cd19f4e7e (diff)
downloadtailscale-53fb25fc2fc49deaae48e36044f80ff1eded9aa9.tar.xz
tailscale-53fb25fc2fc49deaae48e36044f80ff1eded9aa9.zip
all: generate discovery key, plumb it around
Not actually used yet. Updates #483
Diffstat (limited to 'control')
-rw-r--r--control/controlclient/direct.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go
index b6cc66939..3ffeaba87 100644
--- a/control/controlclient/direct.go
+++ b/control/controlclient/direct.go
@@ -85,6 +85,7 @@ type Direct struct {
newDecompressor func() (Decompressor, error)
keepAlive bool
logf logger.Logf
+ discoPubKey tailcfg.DiscoKey
mu sync.Mutex // mutex guards the following fields
serverKey wgcfg.Key
@@ -104,6 +105,7 @@ type Options struct {
AuthKey string // optional node auth key for auto registration
TimeNow func() time.Time // time.Now implementation used by Client
Hostinfo *tailcfg.Hostinfo // non-nil passes ownership, nil means to use default using os.Hostname, etc
+ DiscoPublicKey tailcfg.DiscoKey
NewDecompressor func() (Decompressor, error)
KeepAlive bool
Logf logger.Logf
@@ -153,6 +155,7 @@ func NewDirect(opts Options) (*Direct, error) {
keepAlive: opts.KeepAlive,
persist: opts.Persist,
authKey: opts.AuthKey,
+ discoPubKey: opts.DiscoPublicKey,
}
if opts.Hostinfo == nil {
c.SetHostinfo(NewHostinfo())
@@ -478,6 +481,7 @@ func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*NetworkM
IncludeIPv6: includeIPv6(),
KeepAlive: c.keepAlive,
NodeKey: tailcfg.NodeKey(persist.PrivateNodeKey.Public()),
+ DiscoKey: c.discoPubKey,
Endpoints: ep,
Stream: allowStream,
Hostinfo: hostinfo,