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

Method setNetInfo

tailnet/node.go:137–155  ·  view source on GitHub ↗

setNetInfo processes a NetInfo update from the wireguard engine. c.L MUST NOT be held.

(ni *tailcfg.NetInfo)

Source from the content-addressed store, hash-verified

135// setNetInfo processes a NetInfo update from the wireguard engine. c.L MUST
136// NOT be held.
137func (u *nodeUpdater) setNetInfo(ni *tailcfg.NetInfo) {
138 u.L.Lock()
139 defer u.L.Unlock()
140 dirty := false
141 if u.preferredDERP != ni.PreferredDERP {
142 dirty = true
143 u.preferredDERP = ni.PreferredDERP
144 u.logger.Debug(context.Background(), "new preferred DERP",
145 slog.F("preferred_derp", u.preferredDERP))
146 }
147 if !maps.Equal(u.derpLatency, ni.DERPLatency) {
148 dirty = true
149 u.derpLatency = ni.DERPLatency
150 }
151 if dirty {
152 u.dirty = true
153 u.Broadcast()
154 }
155}
156
157// setDERPForcedWebsocket handles callbacks from the magicConn about DERP regions that are forced to
158// use websockets (instead of Upgrade: derp). This information is for debugging only.

Calls 3

LockMethod · 0.45
UnlockMethod · 0.45
EqualMethod · 0.45