mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
ipn/ipnlocal: eagerly announce peerapi service(s) on change
We were previously only doing it as a side effect of the port poller, which doesn't run on e.g. iOS. Updates tailscale/corp#1559
This commit is contained in:
parent
fe23506471
commit
227f73284f
@ -1423,6 +1423,10 @@ func (b *LocalBackend) peerAPIServicesLocked() (ret []tailcfg.Service) {
|
||||
// TODO(danderson): we shouldn't be mangling hostinfo here after
|
||||
// painstakingly constructing it in twelvety other places.
|
||||
func (b *LocalBackend) doSetHostinfoFilterServices(hi *tailcfg.Hostinfo) {
|
||||
if hi == nil {
|
||||
b.logf("[unexpected] doSetHostinfoFilterServices with nil hostinfo")
|
||||
return
|
||||
}
|
||||
b.mu.Lock()
|
||||
cc := b.cc
|
||||
if cc == nil {
|
||||
@ -1682,6 +1686,8 @@ func (b *LocalBackend) initPeerAPIListener() {
|
||||
go pln.serve()
|
||||
b.peerAPIListeners = append(b.peerAPIListeners, pln)
|
||||
}
|
||||
|
||||
b.doSetHostinfoFilterServices(b.hostinfo)
|
||||
}
|
||||
|
||||
// magicDNSRootDomains returns the subset of nm.DNS.Domains that are the search domains for MagicDNS.
|
||||
|
Loading…
Reference in New Issue
Block a user