netstack/tcp: Add LastAck transition.

Add missing state transition to LastAck, which should happen when the
endpoint has already recieved a FIN from the remote side, and is
sending its own FIN.

PiperOrigin-RevId: 265568314
This commit is contained in:
Rahat Mahmood 2019-08-26 16:38:04 -07:00 committed by gVisor bot
parent 904b156962
commit 1fdefd41c5
1 changed files with 8 additions and 1 deletions

View File

@ -664,7 +664,14 @@ func (s *sender) maybeSendSegment(seg *segment, limit int, end seqnum.Value) (se
segEnd = seg.sequenceNumber.Add(1)
// Transition to FIN-WAIT1 state since we're initiating an active close.
s.ep.mu.Lock()
s.ep.state = StateFinWait1
switch s.ep.state {
case StateCloseWait:
// We've already received a FIN and are now sending our own. The
// sender is now awaiting a final ACK for this FIN.
s.ep.state = StateLastAck
default:
s.ep.state = StateFinWait1
}
s.ep.mu.Unlock()
} else {
// We're sending a non-FIN segment.