From c576fea60e5c40962e9e9e8112235d8c60c657ac Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 11 Mar 2021 11:44:01 -0800 Subject: [PATCH] wgengine/magicsock: delete unused WhoIs method that was moved elsewhere Signed-off-by: Brad Fitzpatrick --- wgengine/magicsock/magicsock.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/wgengine/magicsock/magicsock.go b/wgengine/magicsock/magicsock.go index 70ddb99f5..24b9ee7d1 100644 --- a/wgengine/magicsock/magicsock.go +++ b/wgengine/magicsock/magicsock.go @@ -3789,25 +3789,6 @@ func (de *discoEndpoint) numStopAndReset() int64 { // derpStr replaces DERP IPs in s with "derp-". func derpStr(s string) string { return strings.ReplaceAll(s, "127.3.3.40:", "derp-") } -// WhoIs reports the node and user who owns the node with the given IP. -// If ok == true, n and u are valid. -func (c *Conn) WhoIs(ip netaddr.IP) (n *tailcfg.Node, u tailcfg.UserProfile, ok bool) { - c.mu.Lock() - defer c.mu.Unlock() - if c.netMap == nil { - return n, u, false - } - for _, p := range c.netMap.Peers { - for _, ipp := range p.Addresses { - if ipp.IsSingleIP() && ipp.IP == ip { - u, ok := c.netMap.UserProfiles[p.User] - return p, u, ok - } - } - } - return nil, u, false -} - // ippEndpointCache is a mutex-free single-element cache, mapping from // a single netaddr.IPPort to a single endpoint. type ippEndpointCache struct {