From 770aa71ffbfbb01f7c8bfc65ce5e0505c783efde Mon Sep 17 00:00:00 2001 From: Naman Sood Date: Mon, 15 Mar 2021 17:59:35 -0400 Subject: client, cmd/hello, ipn, wgengine: fix whois for netstack-forwarded connections Updates #504 Updates #707 Signed-off-by: Naman Sood --- client/tailscale/tailscale.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'client') diff --git a/client/tailscale/tailscale.go b/client/tailscale/tailscale.go index 9ebbf8fcb..a6d304332 100644 --- a/client/tailscale/tailscale.go +++ b/client/tailscale/tailscale.go @@ -56,17 +56,7 @@ func DoLocalRequest(req *http.Request) (*http.Response, error) { // WhoIs returns the owner of the remoteAddr, which must be an IP or IP:port. func WhoIs(ctx context.Context, remoteAddr string) (*tailcfg.WhoIsResponse, error) { - var ip string - if net.ParseIP(remoteAddr) != nil { - ip = remoteAddr - } else { - var err error - ip, _, err = net.SplitHostPort(remoteAddr) - if err != nil { - return nil, fmt.Errorf("invalid remoteAddr %q", remoteAddr) - } - } - req, err := http.NewRequestWithContext(ctx, "GET", "http://local-tailscaled.sock/localapi/v0/whois?ip="+url.QueryEscape(ip), nil) + req, err := http.NewRequestWithContext(ctx, "GET", "http://local-tailscaled.sock/localapi/v0/whois?addr="+url.QueryEscape(remoteAddr), nil) if err != nil { return nil, err } -- cgit v1.3-3-g829e