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
+10
View File
@@ -1208,6 +1208,16 @@ func TestMapDNSResponseSetsExpiryBasedOnTTL(t *testing.T) {
assertExpiresAt(ipThree, clock.Now().Add(301*time.Second))
assertExpiresAt(ipFour, clock.Now().Add(61*time.Second))
elapsed := time.Second * 30
clock.Advance(elapsed)
assertExpiresAt(ipThree, clock.Now().Add(301*time.Second).Add(-1*elapsed))
assertExpiresAt(ipFour, clock.Now().Add(61*time.Second).Add(-1*elapsed))
c.mapDNSResponse(dnsRespV6)
// after seeing the addresses again, the expiry time is pushed out.
assertExpiresAt(ipThree, clock.Now().Add(301*time.Second))
assertExpiresAt(ipFour, clock.Now().Add(61*time.Second))
}
func TestNormalizedDNSNames(t *testing.T) {