mirror of
https://github.com/tailscale/tailscale.git
synced 2025-11-07 12:46:55 +00:00
cmd/tailscale: add debug commands to break connections
For testing reconnects. Updates tailscale/corp#5761 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
99e06d3544
commit
92fc9a01fa
@@ -5026,3 +5026,20 @@ func (b *LocalBackend) GetPeerEndpointChanges(ctx context.Context, ip netip.Addr
|
||||
}
|
||||
return chs, nil
|
||||
}
|
||||
|
||||
var breakTCPConns func() error
|
||||
|
||||
func (b *LocalBackend) DebugBreakTCPConns() error {
|
||||
if breakTCPConns == nil {
|
||||
return errors.New("TCP connection breaking not available on this platform")
|
||||
}
|
||||
return breakTCPConns()
|
||||
}
|
||||
|
||||
func (b *LocalBackend) DebugBreakDERPConns() error {
|
||||
mc, err := b.magicConn()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return mc.DebugBreakDERPConns()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user