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

@@ -23,8 +23,6 @@ import (
// The fields should all be considered read-only. They might
// alias parts of previous NetworkMap values.
type NetworkMap struct {
// Core networking
SelfNode tailcfg.NodeView
NodeKey key.NodePublic
PrivateKey key.NodePrivate
@@ -44,10 +42,10 @@ type NetworkMap struct {
MachineStatus tailcfg.MachineStatus
MachineKey key.MachinePublic
Peers []tailcfg.NodeView // sorted by Node.ID
DNS tailcfg.DNSConfig
// TODO(maisem) : replace with View.
Hostinfo tailcfg.Hostinfo
Peers []tailcfg.NodeView // sorted by Node.ID
DNS tailcfg.DNSConfig
PacketFilter []filter.Match
PacketFilterRules views.Slice[tailcfg.FilterRule]
SSHPolicy *tailcfg.SSHPolicy // or nil, if not enabled/allowed