mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
Only send tailnet nodes updates with preferred DERP (#7387)
Signed-off-by: Spike Curtis <spike@coder.com>
This commit is contained in:
@ -631,6 +631,14 @@ func (c *Conn) sendNode() {
|
||||
return
|
||||
}
|
||||
node := c.selfNode()
|
||||
// Conn.UpdateNodes will skip any nodes that don't have the PreferredDERP
|
||||
// set to non-zero, since we cannot reach nodes without DERP for discovery.
|
||||
// Therefore, there is no point in sending the node without this, and we can
|
||||
// save ourselves from churn in the tailscale/wireguard layer.
|
||||
if node.PreferredDERP == 0 {
|
||||
c.logger.Debug(context.Background(), "skipped sending node; no PreferredDERP", slog.F("node", node))
|
||||
return
|
||||
}
|
||||
nodeCallback := c.nodeCallback
|
||||
if nodeCallback == nil {
|
||||
return
|
||||
|
Reference in New Issue
Block a user