summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorM. J. Fromberger <fromberger@tailscale.com>2026-04-02 16:24:52 -0700
committerM. J. Fromberger <fromberger@tailscale.com>2026-04-02 17:44:05 -0700
commite3b1329802adabca6b9f27300f5ae99e0621906b (patch)
tree9be900a5d7a0172bda3df8e9eac82b2b30eef142
parenteaa5d9df4b83a944b023581a35af3b71527a3684 (diff)
downloadtailscale-mjf/nmc-status.tar.xz
tailscale-mjf/nmc-status.zip
ipn/ipn{local,state}: add a status indicator for a cached netmapmjf/nmc-status
Add a new UsingCachedNetworkMap flag to the ipnstate.Status message. Populate it as true when self has a network map that was loaded from cache, vs. being directly provided by the control plane. Updates #12639 Change-Id: I0fd5b1d6ec8df5cec5d4a3fa6b263293124780d1 Signed-off-by: M. J. Fromberger <fromberger@tailscale.com>
-rw-r--r--ipn/ipnlocal/local.go1
-rw-r--r--ipn/ipnstate/ipnstate.go6
2 files changed, 7 insertions, 0 deletions
diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go
index 5d3bbd36e..9e2d6b197 100644
--- a/ipn/ipnlocal/local.go
+++ b/ipn/ipnlocal/local.go
@@ -1314,6 +1314,7 @@ func (b *LocalBackend) UpdateStatus(sb *ipnstate.StatusBuilder) {
s.CurrentTailnet.MagicDNSSuffix = nm.MagicDNSSuffix()
s.CurrentTailnet.MagicDNSEnabled = nm.DNS.Proxied
s.CurrentTailnet.Name = nm.Domain
+ s.UsingCachedNetworkMap = nm.Cached
if prefs := b.pm.CurrentPrefs(); prefs.Valid() {
if !prefs.RouteAll() && nm.AnyPeersAdvertiseRoutes() {
s.Health = append(s.Health, healthmsg.WarnAcceptRoutesOff)
diff --git a/ipn/ipnstate/ipnstate.go b/ipn/ipnstate/ipnstate.go
index 17e6ac870..cc1a22399 100644
--- a/ipn/ipnstate/ipnstate.go
+++ b/ipn/ipnstate/ipnstate.go
@@ -48,6 +48,12 @@ type Status struct {
TailscaleIPs []netip.Addr // Tailscale IP(s) assigned to this node
Self *PeerStatus
+ // UsingCachedNetworkMap is whether Self has a network map that was loaded
+ // from a local cache. If false, either Self has no network map (for
+ // example, if the node is not running), or its network map was received
+ // directly from the control plane.
+ UsingCachedNetworkMap bool
+
// ExitNodeStatus describes the current exit node.
// If nil, an exit node is not in use.
ExitNodeStatus *ExitNodeStatus `json:"ExitNodeStatus,omitempty"`