cmd/tailscale: make ping --until-direct require direct connection to exit 0

If --until-direct is set, the goal is to make a direct connection.
If we failed at that, say so, and exit with an error.

RELNOTE=tailscale ping --until-direct (the default) now exits with
a non-zero exit code if no direct connection was established.

Signed-off-by: Josh Bleecher Snyder <josh@tailscale.com>
bradfitz/netstack_port_map
Josh Bleecher Snyder 3 years ago committed by Josh Bleecher Snyder
parent 6fd4e8d244
commit 6f62bbae79

@ -139,6 +139,9 @@ func runPing(ctx context.Context, args []string) error {
if !anyPong {
return errors.New("no reply")
}
if pingArgs.untilDirect {
return errors.New("direct connection not established")
}
return nil
}
}

Loading…
Cancel
Save