From 29306b3f646c57aaa475ffe224b04d4473e364c7 Mon Sep 17 00:00:00 2001 From: Mithun Iyer Date: Tue, 1 Sep 2020 17:40:28 -0700 Subject: Fix handling of unacceptable ACKs during close. On receiving an ACK with unacceptable ACK number, in a closing state, TCP, needs to reply back with an ACK with correct seq and ack numbers and remain in same state. This change is as per RFC793 page 37, but with a difference that it does not apply to ESTABLISHED state, just as in Linux. Also add more tests to check for OTW sequence number and unacceptable ack numbers in these states. Fixes #3785 PiperOrigin-RevId: 329616283 --- test/packetimpact/dut/posix_server.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/packetimpact/dut') diff --git a/test/packetimpact/dut/posix_server.cc b/test/packetimpact/dut/posix_server.cc index 2476998f8..de5b4be93 100644 --- a/test/packetimpact/dut/posix_server.cc +++ b/test/packetimpact/dut/posix_server.cc @@ -336,6 +336,15 @@ class PosixImpl final : public posix_server::Posix::Service { return ::grpc::Status::OK; } + ::grpc::Status Shutdown(grpc_impl::ServerContext *context, + const ::posix_server::ShutdownRequest *request, + ::posix_server::ShutdownResponse *response) override { + if (shutdown(request->fd(), request->how()) < 0) { + response->set_errno_(errno); + } + return ::grpc::Status::OK; + } + ::grpc::Status Recv(::grpc::ServerContext *context, const ::posix_server::RecvRequest *request, ::posix_server::RecvResponse *response) override { -- cgit v1.2.3