mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-02 18:11:59 +00:00
wgengine/magicsock: add new endpoint type used for discovery-supporting peers
This adds a new magicsock endpoint type only used when both sides support discovery (that is, are advertising a discovery key). Otherwise the old code is used. So far the new code only communicates over DERP as proof that the new code paths are wired up. None of the actually discovery messaging is implemented yet. Support for discovery (generating and advertising a key) are still behind an environment variable for now. Updates #483
This commit is contained in:
@@ -8,8 +8,6 @@ import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -362,7 +360,7 @@ func (b *LocalBackend) Start(opts Options) error {
|
||||
b.updateFilter(nil)
|
||||
|
||||
var discoPublic tailcfg.DiscoKey
|
||||
if useDisco, _ := strconv.ParseBool(os.Getenv("TS_DEBUG_USE_DISCO")); useDisco {
|
||||
if controlclient.Debug.Disco {
|
||||
discoPrivate := key.NewPrivate()
|
||||
b.e.SetDiscoPrivateKey(discoPrivate)
|
||||
discoPublic = tailcfg.DiscoKey(discoPrivate.Public())
|
||||
|
||||
Reference in New Issue
Block a user