types/netmap: start phasing out Addresses, add GetAddresses method

NetworkMap.Addresses is redundant with the SelfNode.Addresses. This
works towards a TODO to delete NetworkMap.Addresses and replace it
with a method.

This is similar to #9389.

Updates #cleanup

Change-Id: Id000509ca5d16bb636401763d41bdb5f38513ba0
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2023-09-17 12:53:23 -05:00
committed by Brad Fitzpatrick
parent fb5ceb03e3
commit 926c990a09
6 changed files with 59 additions and 30 deletions

View File

@@ -1816,8 +1816,8 @@ func (c *Conn) SetNetworkMap(nm *netmap.NetworkMap) {
c.peers = curPeers
flags := c.debugFlagsLocked()
if len(nm.Addresses) > 0 {
c.firstAddrForTest = nm.Addresses[0].Addr()
if addrs := nm.GetAddresses(); addrs.Len() > 0 {
c.firstAddrForTest = addrs.At(0).Addr()
} else {
c.firstAddrForTest = netip.Addr{}
}