feature/conn25: extend assignment expiry on use
When we use assigned addresses in response to a DNS request, extend the expiry on the assignment. Updates tailscale/corp#39975 Signed-off-by: Fran Bull <fran@tailscale.com>
This commit is contained in:
@@ -755,6 +755,7 @@ func (c *client) reserveAddresses(appName string, domain dnsname.FQDN, dst netip
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
if existing, ok := c.assignments.lookupByDomainDst(domain, dst); ok {
|
||||
c.assignments.updateFromTTL(existing, ttl)
|
||||
return existing, nil
|
||||
}
|
||||
|
||||
@@ -766,7 +767,7 @@ func (c *client) reserveAddresses(appName string, domain dnsname.FQDN, dst netip
|
||||
now := c.assignments.clock.Now()
|
||||
for range 10 {
|
||||
a := c.assignments.popExpired(now)
|
||||
if !a.isValid() {
|
||||
if a == nil {
|
||||
break
|
||||
}
|
||||
if a.is4() {
|
||||
|
||||
Reference in New Issue
Block a user