Skip to content

Commit e22e7c4

Browse files
committed
netstack: remove timed-out endpoints from pendingEndpoints queue.
When a handshake times out, the endpoint may remain stuck in the lEP's pendingEndpoints queue. Related to google#11536
1 parent b019448 commit e22e7c4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pkg/tcpip/transport/tcp/endpoint.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,14 @@ func (e *Endpoint) cleanupLocked() {
11931193
e.timeWaitTimer.Stop()
11941194
}
11951195

1196+
// Remove current EP from its lEP acceptQueue.pendingEndpoint if exists.
1197+
if e.h != nil && e.h.listenEP != nil {
1198+
lEP := e.h.listenEP
1199+
lEP.acceptMu.Lock()
1200+
delete(lEP.acceptQueue.pendingEndpoints, e)
1201+
lEP.acceptMu.Unlock()
1202+
}
1203+
11961204
// Close all endpoints that might have been accepted by TCP but not by
11971205
// the client.
11981206
e.closePendingAcceptableConnectionsLocked()

0 commit comments

Comments
 (0)