ipn/ipnlocal: ensure that hostinfo is updated on app connector preference changes

Some conditional paths may otherwise skip the hostinfo update, so kick
it off asynchronously as other code paths do.

Updates tailscale/corp#15437
Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:
James Tucker
2023-11-09 17:21:10 -08:00
committed by James Tucker
parent 933d201bba
commit 45be37cb01
2 changed files with 60 additions and 1 deletions

View File

@@ -3272,7 +3272,13 @@ func (b *LocalBackend) reconfigAppConnectorLocked(nm *netmap.NetworkMap, prefs i
const appConnectorCapName = "tailscale.com/app-connectors"
if !prefs.AppConnector().Advertise {
b.appConnector = nil
var old *appc.AppConnector
old, b.appConnector = b.appConnector, nil
if old != nil {
// Ensure that the app connector service will not be advertised now
// that b.appConnector is no longer set.
go b.doSetHostinfoFilterServices()
}
return
}
@@ -3306,6 +3312,10 @@ func (b *LocalBackend) reconfigAppConnectorLocked(nm *netmap.NetworkMap, prefs i
slices.Sort(domains)
slices.Compact(domains)
b.appConnector.UpdateDomains(domains)
// Ensure that the app connector service will be advertised now that
// b.appConnector is set.
go b.doSetHostinfoFilterServices()
}
// authReconfig pushes a new configuration into wgengine, if engine