types/netmap: remove redundant Netmap.Hostinfo

It was in SelfNode.Hostinfo anyway. The redundant copy was just
costing us an allocation per netmap (a Hostinfo.Clone).

Updates #1909

Change-Id: Ifac568aa5f8054d9419828489442a0f4559bc099
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-08-22 09:41:52 -07:00
committed by Brad Fitzpatrick
parent 50b558de74
commit 947def7688
4 changed files with 15 additions and 18 deletions

View File

@@ -704,7 +704,9 @@ func (b *LocalBackend) updateStatus(sb *ipnstate.StatusBuilder, extraLocked func
ss.Online = health.GetInPollNetMap()
if b.netMap != nil {
ss.InNetworkMap = true
ss.HostName = b.netMap.Hostinfo.Hostname
if hi := b.netMap.SelfNode.Hostinfo(); hi.Valid() {
ss.HostName = hi.Hostname()
}
ss.DNSName = b.netMap.Name
ss.UserID = b.netMap.User()
if sn := b.netMap.SelfNode; sn.Valid() {