summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/transport/tcp
diff options
context:
space:
mode:
authorBrian Geffon <bgeffon@google.com>2018-05-24 15:45:55 -0700
committerShentubot <shentubot@google.com>2018-05-24 15:46:50 -0700
commita8b90a7158d4197428639c912d97f3bdbaf63f5a (patch)
tree9231803fe00925d4e33a784fe4187c79b5517d23 /pkg/tcpip/transport/tcp
parent7f62e9c32ea6af19ccd92107252fd869e6ef1005 (diff)
Poll should wake up on ECONNREFUSED with no mask.
Today poll will not wake up on a ECONNREFUSED if no poll mask is specified, which is equivalent to POLLHUP | POLLERR which are implicitly added during the poll syscall. PiperOrigin-RevId: 197967183 Change-Id: I668d0730c33701228913f2d0843b48491b642efb
Diffstat (limited to 'pkg/tcpip/transport/tcp')
-rw-r--r--pkg/tcpip/transport/tcp/connect.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/tcpip/transport/tcp/connect.go b/pkg/tcpip/transport/tcp/connect.go
index efd69fa86..66904856c 100644
--- a/pkg/tcpip/transport/tcp/connect.go
+++ b/pkg/tcpip/transport/tcp/connect.go
@@ -819,7 +819,8 @@ func (e *endpoint) protocolMainLoop(passive bool) *tcpip.Error {
defer func() {
// e.mu is expected to be held upon entering this section.
- e.waiterQueue.Notify(waiter.EventIn | waiter.EventOut)
+ // When the protocol loop exits we should wake up our waiters.
+ e.waiterQueue.Notify(waiter.EventHUp | waiter.EventErr | waiter.EventIn | waiter.EventOut)
e.completeWorkerLocked()
if e.snd != nil {
@@ -880,9 +881,6 @@ func (e *endpoint) protocolMainLoop(passive bool) *tcpip.Error {
e.waiterQueue.Notify(waiter.EventOut)
- // When the protocol loop exits we should wake up our waiters with EventHUp.
- defer e.waiterQueue.Notify(waiter.EventHUp)
-
// Set up the functions that will be called when the main protocol loop
// wakes up.
funcs := []struct {