From 4e3ec2d01ad86c2c2b2bc686051874925fafddca Mon Sep 17 00:00:00 2001 From: Eugene Adell Date: Fri, 12 Feb 2021 21:45:54 +0100 Subject: [PATCH] TCP: last out-of-order packet is marked as a retransmission In some circumstances when dealing with a series of out-of-order packets, the last packet of this series is marked as a retransmission instead of an out-of-order. Closes #17214. --- docbook/wsug_src/WSUG_chapter_advanced.adoc | 2 +- epan/dissectors/packet-tcp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docbook/wsug_src/WSUG_chapter_advanced.adoc b/docbook/wsug_src/WSUG_chapter_advanced.adoc index ead6f70551..5347bacc8f 100644 --- a/docbook/wsug_src/WSUG_chapter_advanced.adoc +++ b/docbook/wsug_src/WSUG_chapter_advanced.adoc @@ -503,7 +503,7 @@ Set when all of the following are true: * This is not a keepalive packet. * In the forward direction, the segment length is greater than zero or the SYN or FIN is set. * The next expected sequence number is greater than the current sequence number. -* The next expected sequence number and the next sequence number differ. +* The next expected sequence number is greater than or equal to the next sequence number. * The last segment arrived within the Out-Of-Order RTT threshold. The threshold is either the value shown in the “iRTT” (tcp.analysis.initial_rtt) field under “SEQ/ACK analysis” if it is present, or the default value of 3ms if it is not. diff --git a/epan/dissectors/packet-tcp.c b/epan/dissectors/packet-tcp.c index 3c23a4b339..dbfe25efdc 100644 --- a/epan/dissectors/packet-tcp.c +++ b/epan/dissectors/packet-tcp.c @@ -2268,7 +2268,7 @@ finished_fwd: if( seq_not_advanced // XXX is this neccessary? && t < ooo_thres - && tcpd->fwd->tcp_analyze_seq_info->nextseq != seq + seglen ) { + && tcpd->fwd->tcp_analyze_seq_info->nextseq >= seq + seglen ) { if(!tcpd->ta) { tcp_analyze_get_acked_struct(pinfo->num, seq, ack, TRUE, tcpd); }