diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-12-03 16:57:47 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-12-03 16:57:47 +0000 |
commit | fa51e6c93b30a62732019cc55f5ebdcb40c68659 (patch) | |
tree | 3e7aa635e057f90c1ecd0b8e6e2ed0ebab549692 /pkg/tcpip/transport/icmp | |
parent | b90360c0c293247f6e755e937ef518c1a9e0d2df (diff) | |
parent | 3ff1aef544b532c207cf55bcee64fe6717bfd3c4 (diff) |
Merge release-20201130.0-31-g3ff1aef54 (automated)
Diffstat (limited to 'pkg/tcpip/transport/icmp')
-rw-r--r-- | pkg/tcpip/transport/icmp/endpoint.go | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/pkg/tcpip/transport/icmp/endpoint.go b/pkg/tcpip/transport/icmp/endpoint.go index c9054cc35..94fcd72d9 100644 --- a/pkg/tcpip/transport/icmp/endpoint.go +++ b/pkg/tcpip/transport/icmp/endpoint.go @@ -274,26 +274,8 @@ func (e *endpoint) write(p tcpip.Payloader, opts tcpip.WriteOptions) (int64, <-c } } - var route *stack.Route - if to == nil { - route = e.route - - if route.IsResolutionRequired() { - // Promote lock to exclusive if using a shared route, - // given that it may need to change in Route.Resolve() - // call below. - e.mu.RUnlock() - defer e.mu.RLock() - - e.mu.Lock() - defer e.mu.Unlock() - - // Recheck state after lock was re-acquired. - if e.state != stateConnected { - return 0, nil, tcpip.ErrInvalidEndpointState - } - } - } else { + route := e.route + if to != nil { // Reject destination address if it goes through a different // NIC than the endpoint was bound to. nicID := to.NIC |