diff --git a/control/controlclient/auto.go b/control/controlclient/auto.go index 137b8a39b..b8f39adce 100644 --- a/control/controlclient/auto.go +++ b/control/controlclient/auto.go @@ -304,6 +304,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 6ae542eea..512c5884c 100644 --- a/ipn/ipnlocal/local.go +++ b/ipn/ipnlocal/local.go @@ -5694,9 +5694,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,