diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-04-15 08:14:07 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-04-15 08:14:07 +0000 |
commit | aecbfa2d8c4b700b2e02a047a22d4163368432b6 (patch) | |
tree | 72a69b045180ff3bbbf419ed681e1c07069453f3 /pkg/tcpip/transport/tcp/accept.go | |
parent | 4ee17e79b9676b9eaf4e0b266ca249520d3beb20 (diff) | |
parent | 9c918340e4e6126cca1dfedbf28fec8c8f836e1a (diff) |
Merge release-20200323.0-157-g9c91834 (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp/accept.go')
-rw-r--r-- | pkg/tcpip/transport/tcp/accept.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/tcp/accept.go b/pkg/tcpip/transport/tcp/accept.go index 7a9dea4ac..e07b436c4 100644 --- a/pkg/tcpip/transport/tcp/accept.go +++ b/pkg/tcpip/transport/tcp/accept.go @@ -330,6 +330,9 @@ func (l *listenContext) createEndpointAndPerformHandshake(s *segment, opts *head if l.listenEP != nil { l.removePendingEndpoint(ep) } + + ep.drainClosingSegmentQueue() + return nil, err } ep.isConnectNotified = true @@ -378,7 +381,7 @@ func (e *endpoint) deliverAccepted(n *endpoint) { for { if e.acceptedChan == nil { e.acceptMu.Unlock() - n.Close() + n.notifyProtocolGoroutine(notifyReset) return } select { @@ -656,6 +659,8 @@ func (e *endpoint) protocolListenLoop(rcvWnd seqnum.Size) *tcpip.Error { } e.mu.Unlock() + e.drainClosingSegmentQueue() + // Notify waiters that the endpoint is shutdown. e.waiterQueue.Notify(waiter.EventIn | waiter.EventOut | waiter.EventHUp | waiter.EventErr) }() |