mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-08 22:12:21 +00:00
all: generate discovery key, plumb it around
Not actually used yet. Updates #483
This commit is contained in:
@@ -84,6 +84,8 @@ type Conn struct {
|
||||
lastEndpoints []string
|
||||
peerSet map[key.Public]struct{}
|
||||
|
||||
discoPrivate key.Private
|
||||
|
||||
// addrsByUDP is a map of every remote ip:port to a priority
|
||||
// list of endpoint addresses for a peer.
|
||||
// The priority list is provided by wgengine configuration.
|
||||
@@ -476,6 +478,14 @@ func (c *Conn) SetNetInfoCallback(fn func(*tailcfg.NetInfo)) {
|
||||
}
|
||||
}
|
||||
|
||||
// SetDiscoPrivateKey sets the discovery key.
|
||||
func (c *Conn) SetDiscoPrivateKey(k key.Private) {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
c.discoPrivate = k
|
||||
c.logf("magicsock: disco key set; public: %x", k.Public())
|
||||
}
|
||||
|
||||
// c.mu must NOT be held.
|
||||
func (c *Conn) setNearestDERP(derpNum int) (wantDERP bool) {
|
||||
c.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user