Skip to content

Commit 327336a

Browse files
committed
tcp: correct the TIME_WAIT reopen comments
1 parent 72ade32 commit 327336a

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

‎pkg/tcpip/transport/tcp/connect.go‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,10 +1432,9 @@ func (e *Endpoint) handleTimeWaitSegments() (extendTimeWait bool, reuseTW func()
14321432
}
14331433
}
14341434

1435-
// No listening endpoint matches the SYN. If it has no ACK and the
1436-
// stack has a default handler, redeliver it after this endpoint
1437-
// closes instead of dropping it until TIME_WAIT expires. A SYN-ACK
1438-
// is dropped, so it cannot end TIME_WAIT.
1435+
// Redeliver the SYN after this endpoint closes, instead of
1436+
// dropping it until TIME_WAIT expires. A SYN-ACK is not
1437+
// redelivered, so it cannot end TIME_WAIT.
14391438
if !s.flags.Contains(header.TCPFlagAck) && e.stack.TransportProtocolHandler(info.TransProto) != nil {
14401439
// reuseTW owns s and calls s.DecRef.
14411440
reuseTW = func() {

‎pkg/tcpip/transport/tcp/rcv.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,8 +568,8 @@ func (r *receiver) handleTimeWaitSegment(s *segment) (resetTimeWait bool, newSyn
568568
}
569569

570570
// If it's a SYN and the sequence number is higher than any seen before
571-
// for this connection then try and redirect it to a listening endpoint
572-
// if available.
571+
// for this connection then report it as a new SYN, which can reopen the
572+
// connection.
573573
//
574574
// RFC 1122:
575575
// "When a connection is [...] on TIME-WAIT state [...]

0 commit comments

Comments
 (0)