Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions pkg/tcpip/transport/tcp/snd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1704,6 +1704,13 @@ func (s *sender) handleRcvdSegment(rcvdSeg *segment) {
s.detectSpuriousRecovery(hasDSACK, rcvdSeg.parsedOptions.TSEcr)
}

// It is possible for s.outstanding to drop below zero if we get
// a retransmit timeout, reset outstanding to zero but later
// get an ack that cover previously sent data.
if s.Outstanding < 0 {
s.Outstanding = 0
}

// If we are not in fast recovery then update the congestion
// window based on the number of acknowledged packets.
if !s.FastRecovery.Active {
Expand All @@ -1723,13 +1730,6 @@ func (s *sender) handleRcvdSegment(rcvdSeg *segment) {
// Update the send buffer usage and notify potential waiters.
s.ep.updateSndBufferUsage(int(acked))

// It is possible for s.outstanding to drop below zero if we get
// a retransmit timeout, reset outstanding to zero but later
// get an ack that cover previously sent data.
if s.Outstanding < 0 {
s.Outstanding = 0
}

s.SetPipe()

// If all outstanding data was acknowledged the disable the timer.
Expand Down