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

Method setAddresses

tailnet/node.go:198–208  ·  view source on GitHub ↗

setAddresses sets the local addresses for the node. u.L MUST NOT be held.

(ips []netip.Prefix)

Source from the content-addressed store, hash-verified

196
197// setAddresses sets the local addresses for the node. u.L MUST NOT be held.
198func (u *nodeUpdater) setAddresses(ips []netip.Prefix) {
199 u.L.Lock()
200 defer u.L.Unlock()
201 if d := prefixesDifferent(u.addresses, ips); !d {
202 return
203 }
204 u.addresses = make([]netip.Prefix, len(ips))
205 copy(u.addresses, ips)
206 u.dirty = true
207 u.Broadcast()
208}
209
210// setCallback sets the callback for node changes. It also triggers a call
211// for the current node immediately. u.L MUST NOT be held.

Calls 3

prefixesDifferentFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45