diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-08-05 21:14:55 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-08-05 21:14:55 +0000 |
commit | 00fcf4e7b0e3097ef397600e3230405ff1830f37 (patch) | |
tree | 6cf0514672e3184f3c4625e5969f6aa29edcea83 /pkg/tcpip | |
parent | 1d6b9c1e7c040f90f7520abed1fe7ea9aac3b85e (diff) | |
parent | e7b232a5b881c8930db968a7709ebd93cb2cab04 (diff) |
Merge release-20200804.0-22-ge7b232a5b (automated)
Diffstat (limited to 'pkg/tcpip')
-rw-r--r-- | pkg/tcpip/stack/stack.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/tcpip/stack/stack.go b/pkg/tcpip/stack/stack.go index 7189e8e7e..5b19c5d59 100644 --- a/pkg/tcpip/stack/stack.go +++ b/pkg/tcpip/stack/stack.go @@ -1985,8 +1985,8 @@ func generateRandInt64() int64 { // FindNetworkEndpoint returns the network endpoint for the given address. func (s *Stack) FindNetworkEndpoint(netProto tcpip.NetworkProtocolNumber, address tcpip.Address) (NetworkEndpoint, *tcpip.Error) { - s.mu.Lock() - defer s.mu.Unlock() + s.mu.RLock() + defer s.mu.RUnlock() for _, nic := range s.nics { id := NetworkEndpointID{address} @@ -2005,8 +2005,8 @@ func (s *Stack) FindNetworkEndpoint(netProto tcpip.NetworkProtocolNumber, addres // FindNICNameFromID returns the name of the nic for the given NICID. func (s *Stack) FindNICNameFromID(id tcpip.NICID) string { - s.mu.Lock() - defer s.mu.Unlock() + s.mu.RLock() + defer s.mu.RUnlock() nic, ok := s.nics[id] if !ok { |