cmd/tailscale/cli: use DNS name instead of Location to hide Mullvad exit nodes from status output

Previously, we used a non-nil Location as an indicator that a peer is a Mullvad exit node.
However, this is not, or no longer, reliable, since regular exit nodes may also have a non-nil Location,
such as when traffic steering is enabled for a tailnet.

In this PR, we update the plaintext `tailscale status` output to omit only Mullvad exit nodes, rather than all
exit nodes with a non-nil Location. The JSON output remains unchanged and continues to include all peers.

Updates tailscale/corp#30614

Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
Nick Khyl 2025-07-22 18:57:24 -05:00 committed by Nick Khyl
parent 179745b83e
commit c87f44b687

View File

@ -70,6 +70,8 @@ var statusArgs struct {
peers bool // in CLI mode, show status of peer machines peers bool // in CLI mode, show status of peer machines
} }
const mullvadTCD = "mullvad.ts.net."
func runStatus(ctx context.Context, args []string) error { func runStatus(ctx context.Context, args []string) error {
if len(args) > 0 { if len(args) > 0 {
return errors.New("unexpected non-flag arguments to 'tailscale status'") return errors.New("unexpected non-flag arguments to 'tailscale status'")
@ -212,9 +214,8 @@ func runStatus(ctx context.Context, args []string) error {
if ps.ShareeNode { if ps.ShareeNode {
continue continue
} }
if ps.Location != nil && ps.ExitNodeOption && !ps.ExitNode { if ps.ExitNodeOption && !ps.ExitNode && strings.HasSuffix(ps.DNSName, mullvadTCD) {
// Location based exit nodes are only shown with the // Mullvad exit nodes are only shown with the `exit-node list` command.
// `exit-node list` command.
locBasedExitNode = true locBasedExitNode = true
continue continue
} }