From fb0123ec61cf7e8a8bacbae18d700d63a5c5e314 Mon Sep 17 00:00:00 2001 From: Asias He Date: Fri, 24 Oct 2014 16:25:35 +0800 Subject: [PATCH] tcp: Ack data and FIN in a single packet --- net/tcp.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/tcp.hh b/net/tcp.hh index 37dd81e1f4..a9034880e1 100644 --- a/net/tcp.hh +++ b/net/tcp.hh @@ -520,7 +520,11 @@ void tcp::tcb::input(tcp_hdr* th, packet p) { _rcv._user_waiting = false; _rcv._data_received.set_value(); } + // If this packet contains data as well, we can ACK both data + // and in a single packet, so canncel the previous ACK. + clear_delayed_ack(); output(); + // FIXME: Implement TIME-WAIT state if (both_closed()) { clear_delayed_ack();