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:
Fran Bull
2026-05-26 07:28:47 -07:00
committed by franbull
parent 5877809097
commit 2eb45c2457
4 changed files with 92 additions and 16 deletions
+2 -1
View File
@@ -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() {