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

Method updateByNodeLocked

tailnet/telemetry.go:189–205  ·  view source on GitHub ↗

Update the telemetry store with the current self node state. Returns true if the home DERP has changed.

(n *tailcfg.Node)

Source from the content-addressed store, hash-verified

187// Update the telemetry store with the current self node state.
188// Returns true if the home DERP has changed.
189func (b *TelemetryStore) updateByNodeLocked(n *tailcfg.Node) bool {
190 if n == nil {
191 return false
192 }
193 // #nosec G115 - Safe conversion as n.ID is expected to be within uint64 range for node IDs
194 b.nodeIDSelf = uint64(n.ID)
195 derpIP, err := netip.ParseAddrPort(n.DERP)
196 if err != nil {
197 return false
198 }
199 newHome := int32(derpIP.Port())
200 if b.homeDerp != newHome {
201 b.homeDerp = newHome
202 return true
203 }
204 return false
205}
206
207// Store an anonymized proto.Netcheck given a tailscale NetInfo.
208func (b *TelemetryStore) setNetInfo(ni *tailcfg.NetInfo) {

Callers 1

updateNetworkMapMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected