summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-03-06 19:45:12 +0000
committergVisor bot <gvisor-bot@google.com>2020-03-06 19:45:12 +0000
commit0f6afc62af12ec4fb50171057f335703e0989b03 (patch)
treec215fd33df9450fa8e5783550eee1c0f90f8fe48 /pkg/tcpip/transport/tcp
parent13918861a299e0689f72aa2e37acf828d7190183 (diff)
parentd5dbe366bf7c9f5b648b8114a9dc7f45589899b1 (diff)
Merge release-20200219.0-117-gd5dbe36 (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r--pkg/tcpip/transport/tcp/endpoint.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/tcp/endpoint.go b/pkg/tcpip/transport/tcp/endpoint.go
index 40cc664c0..dc9c18b6f 100644
--- a/pkg/tcpip/transport/tcp/endpoint.go
+++ b/pkg/tcpip/transport/tcp/endpoint.go
@@ -2117,10 +2117,13 @@ func (e *endpoint) Shutdown(flags tcpip.ShutdownFlags) *tcpip.Error {
// Close for write.
if (e.shutdownFlags & tcpip.ShutdownWrite) != 0 {
e.sndBufMu.Lock()
-
if e.sndClosed {
// Already closed.
e.sndBufMu.Unlock()
+ if e.EndpointState() == StateTimeWait {
+ e.mu.Unlock()
+ return tcpip.ErrNotConnected
+ }
break
}