diff --git a/control/controlclient/direct.go b/control/controlclient/direct.go index bec6377cf..e5f2c3de7 100644 --- a/control/controlclient/direct.go +++ b/control/controlclient/direct.go @@ -530,16 +530,14 @@ func (c *Direct) PollNetMap(ctx context.Context, maxPolls int, cb func(*NetworkM } request := tailcfg.MapRequest{ - Version: 4, - IncludeIPv6: true, - DeltaPeers: true, - KeepAlive: c.keepAlive, - NodeKey: tailcfg.NodeKey(persist.PrivateNodeKey.Public()), - DiscoKey: c.discoPubKey, - Endpoints: ep, - Stream: allowStream, - Hostinfo: hostinfo, - DebugFlags: c.debugFlags, + Version: 5, + KeepAlive: c.keepAlive, + NodeKey: tailcfg.NodeKey(persist.PrivateNodeKey.Public()), + DiscoKey: c.discoPubKey, + Endpoints: ep, + Stream: allowStream, + Hostinfo: hostinfo, + DebugFlags: c.debugFlags, } if c.newDecompressor != nil { request.Compress = "zstd" diff --git a/tailcfg/tailcfg.go b/tailcfg/tailcfg.go index 424294e45..2719cb3aa 100644 --- a/tailcfg/tailcfg.go +++ b/tailcfg/tailcfg.go @@ -461,17 +461,23 @@ type RegisterResponse struct { // using the local machine key, and sent to: // https://login.tailscale.com/machine//map type MapRequest struct { - Version int // current version is 4 - Compress string // "zstd" or "" (no compression) - 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 // include IPv6 endpoints in returned Node Endpoints - IncludeIPv6Overlay bool // include IPv6 Addresses and AllowedIPs in returned Nodes. - DeltaPeers bool // whether the 2nd+ network map in response should be deltas, using PeersChanged, PeersRemoved - Stream bool // if true, multiple MapResponse objects are returned - Hostinfo *Hostinfo + // Version is incremented whenever the client code changes enough that + // we want to signal to the control server that we're capable of something + // different. + // + // History of versions: + // 3: implicit compression, keep-alives + // 4: opt-in keep-alives via KeepAlive field, opt-in compression via Compress + // 5: 2020-10-19, implies IncludeIPv6, DeltaPeers/DeltaUserProfiles, supports MagicDNS + Version int + Compress string // "zstd" or "" (no compression) + 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 // MapResponse, without updating their Endpoints. The