From 3a9f6f463a4780150c29d10a911fb0c65c47ccac Mon Sep 17 00:00:00 2001 From: Codinget Date: Tue, 16 Jun 2026 01:09:12 +0000 Subject: [PATCH] fix(tsconnect): restart map poll after SetExplicitServices The previous implementation only triggered a lite map update (non-streaming, OmitPeers=true), whose response is discarded. This meant notifyNetMap was never called after setServices, so self.services was never visible to the local node and peers received the update only on their next periodic poll. Add RestartMap() to controlclient.Auto and call it from SetExplicitServices after the lite update. This cancels the current streaming poll and starts a fresh one, causing the control server to send back a full netmap that includes the updated SelfNode.Hostinfo.Services. Co-Authored-By: Claude Sonnet 4.6 --- control/controlclient/auto.go | 6 ++++++ ipn/ipnlocal/local.go | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/control/controlclient/auto.go b/control/controlclient/auto.go index b087e1444..452d24c26 100644 --- a/control/controlclient/auto.go +++ b/control/controlclient/auto.go @@ -302,6 +302,12 @@ func (c *Auto) restartMap() { c.updateControl() } +// RestartMap cancels the existing map poll and starts a fresh streaming one, +// forcing the control server to send a new full netmap response. +func (c *Auto) RestartMap() { + c.restartMap() +} + func (c *Auto) authRoutine() { defer close(c.authDone) bo := backoff.NewBackoff("authRoutine", c.logf, 30*time.Second) diff --git a/ipn/ipnlocal/local.go b/ipn/ipnlocal/local.go index 4bffbea3b..d8797f21d 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -4980,9 +4980,16 @@ func (b *LocalBackend) SetExplicitServices(sl []tailcfg.Service) { } b.hostinfo.Services = sl b.explicitServices = sl + ccAuto := b.ccAuto b.mu.Unlock() b.doSetHostinfoFilterServices() + // Restart the streaming map poll so the control server sends back a fresh + // netmap that includes our updated services in SelfNode, and so peers + // receive the update promptly via the control server's push. + if ccAuto != nil { + ccAuto.RestartMap() + } } // doSetHostinfoFilterServices calls SetHostinfo on the controlclient,