wgengine/netstack: remove unnecessary map in UpdateNetstackIPs

Updates #cleanup

Signed-off-by: Maisem Ali <maisem@tailscale.com>
pull/10060/head
Maisem Ali 1 year ago committed by Maisem Ali
parent d601c81c51
commit eaf8aa63fc

@ -347,17 +347,15 @@ func (ns *Impl) UpdateNetstackIPs(nm *netmap.NetworkMap) {
} }
newIPs := make(map[netip.Prefix]bool) newIPs := make(map[netip.Prefix]bool)
isAddr := map[netip.Prefix]bool{}
if selfNode.Valid() { if selfNode.Valid() {
for i := range selfNode.Addresses().LenIter() { for i := range selfNode.Addresses().LenIter() {
ipp := selfNode.Addresses().At(i) ipp := selfNode.Addresses().At(i)
isAddr[ipp] = true
newIPs[ipp] = true newIPs[ipp] = true
} }
for i := range selfNode.AllowedIPs().LenIter() { if ns.ProcessSubnets {
ipp := selfNode.AllowedIPs().At(i) for i := range selfNode.AllowedIPs().LenIter() {
if !isAddr[ipp] && ns.ProcessSubnets { ipp := selfNode.AllowedIPs().At(i)
newIPs[ipPrefixToAddressWithPrefix(ipp)] = true newIPs[ipp] = true
} }
} }
} }

Loading…
Cancel
Save