From 5d7d5ed7d6ffd8d420f042a22b22e0527e78d441 Mon Sep 17 00:00:00 2001 From: Zeling Feng Date: Fri, 8 May 2020 11:21:40 -0700 Subject: Send ACK to OTW SEQs/unacc ACKs in CLOSE_WAIT This fixed the corresponding packetimpact test. PiperOrigin-RevId: 310593470 --- pkg/tcpip/header/tcp.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'pkg/tcpip/header') diff --git a/pkg/tcpip/header/tcp.go b/pkg/tcpip/header/tcp.go index 21581257b..29454c4b9 100644 --- a/pkg/tcpip/header/tcp.go +++ b/pkg/tcpip/header/tcp.go @@ -609,5 +609,8 @@ func Acceptable(segSeq seqnum.Value, segLen seqnum.Size, rcvNxt, rcvAcc seqnum.V } // Page 70 of RFC 793 allows packets that can be made "acceptable" by trimming // the payload, so we'll accept any payload that overlaps the receieve window. - return rcvNxt.LessThan(segSeq.Add(segLen)) && segSeq.LessThan(rcvAcc) + // segSeq < rcvAcc is more correct according to RFC, however, Linux does it + // differently, it uses segSeq <= rcvAcc, we'd want to keep the same behavior + // as Linux. + return rcvNxt.LessThan(segSeq.Add(segLen)) && segSeq.LessThanEq(rcvAcc) } -- cgit v1.2.3