diff options
author | Zeling Feng <zeling@google.com> | 2021-03-16 16:57:31 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-03-16 16:59:26 -0700 |
commit | 3dd7ad13b4586791cdc1c1efdef90760a7deff8e (patch) | |
tree | d14c20b3288222bb19d607da58704eb3403f1340 | |
parent | 5eede4e7563e245a685d6529dffddbf9c3a53f50 (diff) |
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
-rw-r--r-- | pkg/tcpip/transport/tcp/rcv.go | 2 | ||||
-rw-r--r-- | test/packetimpact/runner/defs.bzl | 2 |
2 files changed, 1 insertions, 3 deletions
diff --git a/pkg/tcpip/transport/tcp/rcv.go b/pkg/tcpip/transport/tcp/rcv.go index a5c82b8fa..bc6793fc6 100644 --- a/pkg/tcpip/transport/tcp/rcv.go +++ b/pkg/tcpip/transport/tcp/rcv.go @@ -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 { diff --git a/test/packetimpact/runner/defs.bzl b/test/packetimpact/runner/defs.bzl index 567f64c41..803a87a07 100644 --- a/test/packetimpact/runner/defs.bzl +++ b/test/packetimpact/runner/defs.bzl @@ -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, ), ] |