mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-10 00:51:07 +00:00
cmd/tailscale,net/netcheck: add debug feature to force preferred DERP
This provides an interface for a user to force a preferred DERP outcome for all future netchecks that will take precedence unless the forced region is unreachable. The option does not persist and will be lost when the daemon restarts. Updates tailscale/corp#18997 Updates tailscale/corp#24755 Signed-off-by: James Tucker <james@tailscale.com>
This commit is contained in:

committed by
James Tucker

parent
74069774be
commit
7f9ebc0a83
@@ -3013,6 +3013,14 @@ func (c *Conn) DebugPickNewDERP() error {
|
||||
return errors.New("too few regions")
|
||||
}
|
||||
|
||||
func (c *Conn) DebugForcePreferDERP(n int) {
|
||||
c.mu.Lock()
|
||||
defer c.mu.Unlock()
|
||||
|
||||
c.logf("magicsock: [debug] force preferred DERP set to: %d", n)
|
||||
c.netChecker.SetForcePreferredDERP(n)
|
||||
}
|
||||
|
||||
// portableTrySetSocketBuffer sets SO_SNDBUF and SO_RECVBUF on pconn to socketBufferSize,
|
||||
// logging an error if it occurs.
|
||||
func portableTrySetSocketBuffer(pconn nettype.PacketConn, logf logger.Logf) {
|
||||
|
Reference in New Issue
Block a user