tailcfg: bump, document MapRequest.Version value

Fixes tailscale/corp#634

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
reviewable/pr858/r1
Brad Fitzpatrick 2020-10-19 15:32:22 -07:00 committed by Brad Fitzpatrick
parent 3909c82f3d
commit 9957c45995
2 changed files with 25 additions and 21 deletions

View File

@ -530,16 +530,14 @@ func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*NetworkM
} }
request := tailcfg.MapRequest{ request := tailcfg.MapRequest{
Version: 4, Version: 5,
IncludeIPv6: true, KeepAlive: c.keepAlive,
DeltaPeers: true, NodeKey: tailcfg.NodeKey(persist.PrivateNodeKey.Public()),
KeepAlive: c.keepAlive, DiscoKey: c.discoPubKey,
NodeKey: tailcfg.NodeKey(persist.PrivateNodeKey.Public()), Endpoints: ep,
DiscoKey: c.discoPubKey, Stream: allowStream,
Endpoints: ep, Hostinfo: hostinfo,
Stream: allowStream, DebugFlags: c.debugFlags,
Hostinfo: hostinfo,
DebugFlags: c.debugFlags,
} }
if c.newDecompressor != nil { if c.newDecompressor != nil {
request.Compress = "zstd" request.Compress = "zstd"

View File

@ -461,17 +461,23 @@ type RegisterResponse struct {
// using the local machine key, and sent to: // using the local machine key, and sent to:
// https://login.tailscale.com/machine/<mkey hex>/map // https://login.tailscale.com/machine/<mkey hex>/map
type MapRequest struct { type MapRequest struct {
Version int // current version is 4 // Version is incremented whenever the client code changes enough that
Compress string // "zstd" or "" (no compression) // we want to signal to the control server that we're capable of something
KeepAlive bool // whether server should send keep-alives back to us // different.
NodeKey NodeKey //
DiscoKey DiscoKey // History of versions:
Endpoints []string // caller's endpoints (IPv4 or IPv6) // 3: implicit compression, keep-alives
IncludeIPv6 bool // include IPv6 endpoints in returned Node Endpoints // 4: opt-in keep-alives via KeepAlive field, opt-in compression via Compress
IncludeIPv6Overlay bool // include IPv6 Addresses and AllowedIPs in returned Nodes. // 5: 2020-10-19, implies IncludeIPv6, DeltaPeers/DeltaUserProfiles, supports MagicDNS
DeltaPeers bool // whether the 2nd+ network map in response should be deltas, using PeersChanged, PeersRemoved Version int
Stream bool // if true, multiple MapResponse objects are returned Compress string // "zstd" or "" (no compression)
Hostinfo *Hostinfo KeepAlive bool // whether server should send keep-alives back to us
NodeKey NodeKey
DiscoKey DiscoKey
Endpoints []string // caller's endpoints (IPv4 or IPv6)
IncludeIPv6 bool `json:",omitempty"` // include IPv6 endpoints in returned Node Endpoints (for Version 4 clients)
Stream bool // if true, multiple MapResponse objects are returned
Hostinfo *Hostinfo
// ReadOnly is whether the client just wants to fetch the // ReadOnly is whether the client just wants to fetch the
// MapResponse, without updating their Endpoints. The // MapResponse, without updating their Endpoints. The