diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-02-24 18:35:21 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-02-24 18:35:21 +0000 |
commit | 137f1d92f4dcc5e1dd3430c714b503209cec5beb (patch) | |
tree | a469326ec9a0be502a19b1d3233074d9c21ee276 /pkg/tcpip/transport/tcp/accept.go | |
parent | c9bfc173aa5b829cb52b25008a9550d3469c86e8 (diff) | |
parent | c37b196455e8b3816298e3eea98e4ee2dab8d368 (diff) |
Merge release-20200219.0-27-gc37b196 (automated)
Diffstat (limited to 'pkg/tcpip/transport/tcp/accept.go')
-rw-r--r-- | pkg/tcpip/transport/tcp/accept.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pkg/tcpip/transport/tcp/accept.go b/pkg/tcpip/transport/tcp/accept.go index 08afb7c17..13e383ffc 100644 --- a/pkg/tcpip/transport/tcp/accept.go +++ b/pkg/tcpip/transport/tcp/accept.go @@ -299,6 +299,13 @@ func (l *listenContext) createEndpointAndPerformHandshake(s *segment, opts *head h := newPassiveHandshake(ep, seqnum.Size(ep.initialReceiveWindow()), isn, irs, opts, deferAccept) if err := h.execute(); err != nil { ep.Close() + // Wake up any waiters. This is strictly not required normally + // as a socket that was never accepted can't really have any + // registered waiters except when stack.Wait() is called which + // waits for all registered endpoints to stop and expects an + // EventHUp. + ep.waiterQueue.Notify(waiter.EventHUp | waiter.EventErr | waiter.EventIn | waiter.EventOut) + if l.listenEP != nil { l.removePendingEndpoint(ep) } @@ -607,7 +614,7 @@ func (e *endpoint) protocolListenLoop(rcvWnd seqnum.Size) *tcpip.Error { e.mu.Unlock() // Notify waiters that the endpoint is shutdown. - e.waiterQueue.Notify(waiter.EventIn | waiter.EventOut) + e.waiterQueue.Notify(waiter.EventIn | waiter.EventOut | waiter.EventHUp | waiter.EventErr) }() s := sleep.Sleeper{} |