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 /ipn/localapi | |
| 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 'ipn/localapi')
| -rw-r--r-- | ipn/localapi/localapi.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ipn/localapi/localapi.go b/ipn/localapi/localapi.go index 7162a65ee..4e0dba3da 100644 --- a/ipn/localapi/localapi.go +++ b/ipn/localapi/localapi.go @@ -67,21 +67,21 @@ func (h *Handler) serveWhoIs(w http.ResponseWriter, r *http.Request) { return } b := h.b - var ip netaddr.IP - if v := r.FormValue("ip"); v != "" { + var ipp netaddr.IPPort + if v := r.FormValue("addr"); v != "" { var err error - ip, err = netaddr.ParseIP(r.FormValue("ip")) + ipp, err = netaddr.ParseIPPort(v) if err != nil { - http.Error(w, "invalid 'ip' parameter", 400) + http.Error(w, "invalid 'addr' parameter", 400) return } } else { - http.Error(w, "missing 'ip' parameter", 400) + http.Error(w, "missing 'addr' parameter", 400) return } - n, u, ok := b.WhoIs(ip) + n, u, ok := b.WhoIs(ipp) if !ok { - http.Error(w, "no match for IP", 404) + http.Error(w, "no match for IP:port", 404) return } res := &tailcfg.WhoIsResponse{ |
