Skip to content

Update TCP outstanding to zero if it is negative. #11523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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