MCPcopy Index your code
hub / github.com/coder/coder / setAddresses

Method setAddresses

tailnet/configmaps.go:277–288  ·  view source on GitHub ↗

setAddresses sets the addresses belonging to this node to the given slice. It triggers configuration of the engine if the addresses have changed. c.L MUST NOT be held.

(ips []netip.Prefix)

Source from the content-addressed store, hash-verified

275// triggers configuration of the engine if the addresses have changed.
276// c.L MUST NOT be held.
277func (c *configMaps) setAddresses(ips []netip.Prefix) {
278 c.L.Lock()
279 defer c.L.Unlock()
280 if d := prefixesDifferent(c.addresses, ips); !d {
281 return
282 }
283 c.addresses = make([]netip.Prefix, len(ips))
284 copy(c.addresses, ips)
285 c.netmapDirty = true
286 c.filterDirty = true
287 c.Broadcast()
288}
289
290func (c *configMaps) setHosts(hosts map[dnsname.FQDN][]netip.Addr) {
291 c.L.Lock()

Callers

nothing calls this directly

Calls 3

prefixesDifferentFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45

Tested by

no test coverage detected