diff --git a/wgengine/netstack/netstack.go b/wgengine/netstack/netstack.go index fba93d905..a2c9217e9 100644 --- a/wgengine/netstack/netstack.go +++ b/wgengine/netstack/netstack.go @@ -347,17 +347,15 @@ func (ns *Impl) UpdateNetstackIPs(nm *netmap.NetworkMap) { } newIPs := make(map[netip.Prefix]bool) - isAddr := map[netip.Prefix]bool{} if selfNode.Valid() { for i := range selfNode.Addresses().LenIter() { ipp := selfNode.Addresses().At(i) - isAddr[ipp] = true newIPs[ipp] = true } - for i := range selfNode.AllowedIPs().LenIter() { - ipp := selfNode.AllowedIPs().At(i) - if !isAddr[ipp] && ns.ProcessSubnets { - newIPs[ipPrefixToAddressWithPrefix(ipp)] = true + if ns.ProcessSubnets { + for i := range selfNode.AllowedIPs().LenIter() { + ipp := selfNode.AllowedIPs().At(i) + newIPs[ipp] = true } } }