Fix tcp_fin_retransmission_netstack_test

Netstack does not check ACK number for FIN-ACK packets and goes into TIMEWAIT
unconditionally. Fixing the state machine will give us back the retransmission
of FIN.

PiperOrigin-RevId: 363301883
This commit is contained in:
Zeling Feng
2021-03-16 16:59:26 -07:00
committed by gVisor bot
parent 5eede4e756
commit 3dd7ad13b4
2 changed files with 1 additions and 3 deletions
+1 -1
View File
@@ -260,7 +260,7 @@ func (r *receiver) consumeSegment(s *segment, segSeq seqnum.Value, segLen seqnum
case StateEstablished:
r.ep.setEndpointState(StateCloseWait)
case StateFinWait1:
if s.flagIsSet(header.TCPFlagAck) {
if s.flagIsSet(header.TCPFlagAck) && s.ackNumber == r.ep.snd.sndNxt {
// FIN-ACK, transition to TIME-WAIT.
r.ep.setEndpointState(StateTimeWait)
} else {
-2
View File
@@ -289,8 +289,6 @@ ALL_TESTS = [
),
PacketimpactTestInfo(
name = "tcp_fin_retransmission",
# TODO(b/181625316): Fix netstack then remove the line below.
expect_netstack_failure = True,
),
]