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

Method updateDerpMapLocked

tailnet/telemetry.go:165–185  ·  view source on GitHub ↗
(cur *tailcfg.DERPMap)

Source from the content-addressed store, hash-verified

163}
164
165func (b *TelemetryStore) updateDerpMapLocked(cur *tailcfg.DERPMap) {
166 if cur == nil {
167 return
168 }
169 cleanMap := cur.Clone()
170 for _, r := range cleanMap.Regions {
171 for _, n := range r.Nodes {
172 ipv4, _, _ := b.processIPLocked(n.IPv4)
173 n.IPv4 = ipv4
174 ipv6, _, _ := b.processIPLocked(n.IPv6)
175 n.IPv6 = ipv6
176 stunIP, _, _ := b.processIPLocked(n.STUNTestIP)
177 n.STUNTestIP = stunIP
178 hn := b.hashAddrorHostname(n.HostName)
179 n.HostName = hn
180 cn := b.hashAddrorHostname(n.CertName)
181 n.CertName = cn
182 }
183 }
184 b.cleanDerpMap = cleanMap
185}
186
187// Update the telemetry store with the current self node state.
188// Returns true if the home DERP has changed.

Callers 2

updateNetworkMapMethod · 0.95
updateDerpMapMethod · 0.95

Calls 3

processIPLockedMethod · 0.95
hashAddrorHostnameMethod · 0.95
CloneMethod · 0.45

Tested by

no test coverage detected