From 3dd7ad13b4586791cdc1c1efdef90760a7deff8e Mon Sep 17 00:00:00 2001 From: Zeling Feng Date: Tue, 16 Mar 2021 16:57:31 -0700 Subject: 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 --- pkg/tcpip/transport/tcp/rcv.go | 2 +- test/packetimpact/runner/defs.bzl | 2 -- 2 files changed, 1 insertion(+), 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, ), ] -- cgit v1.2.3