aboutgitcodebugslistschat
path: root/tcp.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2021-09-14 16:50:09 +0200
committerStefano Brivio <sbrivio@redhat.com>2021-09-14 16:57:50 +0200
commit7c82ea4dd910bd68214c41d9c872e73cf2dc8554 (patch)
tree59fe52d3ee2b29ee4a22299f862cb267e6c99407 /tcp.c
parentc162f1e80197f4801f89638db741cfe372c4f215 (diff)
downloadpasst-7c82ea4dd910bd68214c41d9c872e73cf2dc8554.tar
passt-7c82ea4dd910bd68214c41d9c872e73cf2dc8554.tar.gz
passt-7c82ea4dd910bd68214c41d9c872e73cf2dc8554.tar.bz2
passt-7c82ea4dd910bd68214c41d9c872e73cf2dc8554.tar.lz
passt-7c82ea4dd910bd68214c41d9c872e73cf2dc8554.tar.xz
passt-7c82ea4dd910bd68214c41d9c872e73cf2dc8554.tar.zst
passt-7c82ea4dd910bd68214c41d9c872e73cf2dc8554.zip
tcp: Don't mistake a FIN segment with no data for a Fast Retransmit request
It carries no data and usually duplicates the previous ACK sequence, but it's just a FIN. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'tcp.c')
-rw-r--r--tcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tcp.c b/tcp.c
index baf3c08..9f9b62d 100644
--- a/tcp.c
+++ b/tcp.c
@@ -2007,7 +2007,8 @@ static void tcp_data_from_tap(struct ctx *c, struct tcp_tap_conn *conn,
ack_seq - max_ack_seq < MAX_WINDOW) {
/* Fast re-transmit */
- retr = !len && ack_seq == max_ack_seq &&
+ retr = !len && !th->fin &&
+ ack_seq == max_ack_seq &&
max_ack_seq_wnd == ntohs(th->window);
max_ack_seq_wnd = ntohs(th->window);