tailcfg, control/controlclient: make nil MapResponse.DNSConfig mean unchanged (mapver15)

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-04-12 12:12:13 -07:00
committed by Brad Fitzpatrick
parent a3113a793a
commit ccb322db04
2 changed files with 9 additions and 7 deletions

View File

@@ -717,6 +717,7 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm
}
}()
var lastDNSConfig = new(tailcfg.DNSConfig)
var lastDERPMap *tailcfg.DERPMap
var lastUserProfile = map[tailcfg.UserID]tailcfg.UserProfile{}
var lastParsedPacketFilter []filter.Match
@@ -820,6 +821,9 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm
if pf := resp.PacketFilter; pf != nil {
lastParsedPacketFilter = c.parsePacketFilter(pf)
}
if c := resp.DNSConfig; c != nil {
lastDNSConfig = c
}
if v, ok := resp.CollectServices.Get(); ok {
collectServices = v
@@ -846,7 +850,7 @@ func (c *Direct) sendMapRequest(ctx context.Context, maxPolls int, cb func(*netm
User: resp.Node.User,
UserProfiles: make(map[tailcfg.UserID]tailcfg.UserProfile),
Domain: resp.Domain,
DNS: resp.DNSConfig,
DNS: *lastDNSConfig,
Hostinfo: resp.Node.Hostinfo,
PacketFilter: lastParsedPacketFilter,
CollectServices: collectServices,