summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--pkg/tcpip/transport/tcp/connect.go6
-rw-r--r--pkg/waiter/waiter.go2
2 files changed, 3 insertions, 5 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 {
diff --git a/pkg/waiter/waiter.go b/pkg/waiter/waiter.go
index 56f53f9c3..ab39fa002 100644
--- a/pkg/waiter/waiter.go
+++ b/pkg/waiter/waiter.go
@@ -174,7 +174,7 @@ func (q *Queue) Notify(mask EventMask) {
q.mu.RLock()
for it := q.list.Front(); it != nil; it = it.Next() {
e := it.(*Entry)
- if (mask & e.mask) != 0 {
+ if mask&e.mask != 0 {
e.Callback.Callback(e)
}
}