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
+3 -1
View File
@@ -205,7 +205,9 @@ func (b *LocalBackend) updateServeTCPPortNetMapAddrListenersLocked(ports []uint1
return
}
for _, a := range nm.Addresses {
addrs := nm.GetAddresses()
for i := range addrs.LenIter() {
a := addrs.At(i)
for _, p := range ports {
addrPort := netip.AddrPortFrom(a.Addr(), p)
if _, ok := b.serveListeners[addrPort]; ok {