diff options
author | Ghanan Gowripalan <ghanan@google.com> | 2021-02-06 13:23:44 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-02-06 13:25:28 -0800 |
commit | c5afaf2854679fbb7470f9a615d3c0fbb2af0999 (patch) | |
tree | b25dd9eb5f12eded8d2137f35e6dfa2582dce15c /pkg/tcpip/stack/stack.go | |
parent | 4943347137dd09cd47b22b5998f8823e0bb04de6 (diff) |
Remove (*stack.Stack).FindNetworkEndpoint
The network endpoints only look for other network endpoints of the
same kind. Since the network protocols keeps track of all endpoints,
go through the protocol to find an endpoint with an address instead
of the stack.
PiperOrigin-RevId: 356051498
Diffstat (limited to 'pkg/tcpip/stack/stack.go')
-rw-r--r-- | pkg/tcpip/stack/stack.go | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index 3bb3f61b2..07cd88a6a 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -2063,24 +2063,6 @@ func generateRandInt64() int64 { return v } -// FindNetworkEndpoint returns the network endpoint for the given address. -// -// Returns nil if the address is not associated with any network endpoint. -func (s *Stack) FindNetworkEndpoint(netProto tcpip.NetworkProtocolNumber, address tcpip.Address) NetworkEndpoint { - s.mu.RLock() - defer s.mu.RUnlock() - - for _, nic := range s.nics { - addressEndpoint := nic.getAddressOrCreateTempInner(netProto, address, false /* createTemp */, NeverPrimaryEndpoint) - if addressEndpoint == nil { - continue - } - addressEndpoint.DecRef() - return nic.getNetworkEndpoint(netProto) - } - return nil -} - // FindNICNameFromID returns the name of the NIC for the given NICID. func (s *Stack) FindNICNameFromID(id tcpip.NICID) string { s.mu.RLock() |