mirror of
https://github.com/tailscale/tailscale.git
synced 2026-10-08 11:21:51 -04:00
TS_FORCE_CACHE_NETMAP currently permits full network-map writes without the cache-network-maps capability, but incremental peer updates still require that capability. A forced cache can therefore retain stale peer fields, additions, and removals until the control plane sends another full map. Centralize the cache eligibility check and use it for both full maps and peer deltas. This keeps TS_USE_CACHED_NETMAP as the safety override and uses the existing delta result to evict removed peers by stable ID. Extend TestUpdateNetMapCache to force caching without the control-plane capability and verify on-disk round trips after a peer patch, upsert, and removal.