From 3b451509dd4a12be6c533338dc6bd265876cecd2 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Fri, 9 Apr 2021 18:37:24 -0700 Subject: [PATCH] cmd/tailscale/cli: make advertise-{routes,exit-node} available unconditionally It was only Linux and BSDs before, but now with netstack mode, it also works on Windows and darwin. It's not worth limiting it to certain platforms. Tailscaled itself can complain/fail if it doesn't like the settings for the mode/OS it's operating under. Updates #707 Signed-off-by: Brad Fitzpatrick --- cmd/tailscale/cli/up.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/cmd/tailscale/cli/up.go b/cmd/tailscale/cli/up.go index 086617c1f..a59c5ec6e 100644 --- a/cmd/tailscale/cli/up.go +++ b/cmd/tailscale/cli/up.go @@ -49,10 +49,8 @@ specify any flags, options are reset to their default. upf.StringVar(&upArgs.advertiseTags, "advertise-tags", "", "ACL tags to request (comma-separated, e.g. \"tag:eng,tag:montreal,tag:ssh\")") upf.StringVar(&upArgs.authKey, "authkey", "", "node authorization key") upf.StringVar(&upArgs.hostname, "hostname", "", "hostname to use instead of the one provided by the OS") - if runtime.GOOS == "linux" || isBSD(runtime.GOOS) { - upf.StringVar(&upArgs.advertiseRoutes, "advertise-routes", "", "routes to advertise to other nodes (comma-separated, e.g. \"10.0.0.0/8,192.168.0.0/24\")") - upf.BoolVar(&upArgs.advertiseDefaultRoute, "advertise-exit-node", false, "offer to be an exit node for internet traffic for the tailnet") - } + upf.StringVar(&upArgs.advertiseRoutes, "advertise-routes", "", "routes to advertise to other nodes (comma-separated, e.g. \"10.0.0.0/8,192.168.0.0/24\")") + upf.BoolVar(&upArgs.advertiseDefaultRoute, "advertise-exit-node", false, "offer to be an exit node for internet traffic for the tailnet") if runtime.GOOS == "linux" { upf.BoolVar(&upArgs.snat, "snat-subnet-routes", true, "source NAT traffic to local routes advertised with --advertise-routes") upf.StringVar(&upArgs.netfilterMode, "netfilter-mode", defaultNetfilterMode(), "netfilter mode (one of on, nodivert, off)") @@ -86,10 +84,6 @@ var upArgs struct { hostname string } -func isBSD(s string) bool { - return s == "dragonfly" || s == "freebsd" || s == "netbsd" || s == "openbsd" -} - func warnf(format string, args ...interface{}) { fmt.Printf("Warning: "+format+"\n", args...) }