From 3aaac55a7ac3bcafb229c171936f6d1e5c252158 Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Sun, 1 Mar 2015 18:45:35 +0200 Subject: [PATCH] tcp: fix bad checksum on RST packets We neglected to set offload_info::needs_csum on reset packets, resuling in them being ignored by the recipient. Symptoms include connection attempts to closed ports (seastar = passive end) hanging instead the active end understanding the port is closed. --- net/tcp.hh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/tcp.hh b/net/tcp.hh index 188acb6d5b..1cd31395b1 100644 --- a/net/tcp.hh +++ b/net/tcp.hh @@ -806,15 +806,17 @@ void tcp::respond_with_reset(tcp_hdr* rth, ipaddr local_ip, ipaddr f *th = hton(*th); checksummer csum; + offload_info oi; InetTraits::tcp_pseudo_header_checksum(csum, local_ip, foreign_ip, sizeof(*th)); if (hw_features().tx_csum_l4_offload) { th->checksum = ~csum.get(); + oi.needs_csum = true; } else { csum.sum(p); th->checksum = csum.get(); + oi.needs_csum = false; } - offload_info oi; oi.protocol = ip_protocol_num::tcp; oi.tcp_hdr_len = sizeof(tcp_hdr); p.set_offload_info(oi);