From 82e15d345025970033a2901f19fb4627e2581fe2 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 28 Jun 2021 08:32:12 -0700 Subject: [PATCH] cmd/tailscaled: log SOCKS5 port when port 0 requested Part of #2158 Signed-off-by: Brad Fitzpatrick --- cmd/tailscaled/tailscaled.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/tailscaled/tailscaled.go b/cmd/tailscaled/tailscaled.go index 63296204d..0c5223d14 100644 --- a/cmd/tailscaled/tailscaled.go +++ b/cmd/tailscaled/tailscaled.go @@ -228,6 +228,11 @@ func run() error { if err != nil { log.Fatalf("SOCKS5 listener: %v", err) } + if strings.HasSuffix(args.socksAddr, ":0") { + // Log kernel-selected port number so integration tests + // can find it portably. + log.Printf("SOCKS5 listening on %v", socksListener.Addr()) + } } e, useNetstack, err := createEngine(logf, linkMon)