diff options
| author | Naman Sood <mail@nsood.in> | 2021-03-15 17:59:35 -0400 |
|---|---|---|
| committer | Naman Sood <mail@nsood.in> | 2021-03-15 18:14:09 -0400 |
| commit | 770aa71ffbfbb01f7c8bfc65ce5e0505c783efde (patch) | |
| tree | 32356706a18c3b5604b2f7c6785c4c57f7591266 /client | |
| parent | 44ab0acbdbd8b79af74ea1f8187c4d782ce38635 (diff) | |
| download | tailscale-770aa71ffbfbb01f7c8bfc65ce5e0505c783efde.tar.xz tailscale-770aa71ffbfbb01f7c8bfc65ce5e0505c783efde.zip | |
client, cmd/hello, ipn, wgengine: fix whois for netstack-forwarded connections
Updates #504
Updates #707
Signed-off-by: Naman Sood <mail@nsood.in>
Diffstat (limited to 'client')
| -rw-r--r-- | client/tailscale/tailscale.go | 12 |
1 files changed, 1 insertions, 11 deletions
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 } |
