netMapLocked returns the current NetworkMap as determined by the config we have. c.L must be held.
()
| 219 | // netMapLocked returns the current NetworkMap as determined by the config we |
| 220 | // have. c.L must be held. |
| 221 | func (c *configMaps) netMapLocked() *netmap.NetworkMap { |
| 222 | nm := new(netmap.NetworkMap) |
| 223 | *nm = c.static |
| 224 | |
| 225 | nm.Addresses = make([]netip.Prefix, len(c.addresses)) |
| 226 | copy(nm.Addresses, c.addresses) |
| 227 | |
| 228 | // we don't need to set the DERPMap in the network map because we separately |
| 229 | // send the DERPMap directly via SetDERPMap |
| 230 | nm.Peers = c.peerConfigLocked() |
| 231 | nm.SelfNode.Addresses = nm.Addresses |
| 232 | nm.SelfNode.AllowedIPs = nm.Addresses |
| 233 | return nm |
| 234 | } |
| 235 | |
| 236 | // hostsLocked returns the current DNS hosts mapping. c.L must be held. |
| 237 | func (c *configMaps) hostsLocked() map[dnsname.FQDN][]netip.Addr { |
no test coverage detected