tcp: Use correct wraparound comparison in sequence analysis

maxseqtobeacked needs to be increased when it's lower than
nextseq, not the other way around, otherwise we can get repeated
extra TCP ACKed unseen segment messages.

Since sequence analysis is always on the absolute sequence
numbers, not relative, it needs to use LT_SEQ to handle wraparound.

Fix #18558. Fix #18633.
This commit is contained in:
John Thacker 2022-11-10 20:18:00 -05:00
parent 9b644f7f84
commit 8fd375cfad
1 changed files with 1 additions and 1 deletions

View File

@ -2382,7 +2382,7 @@ finished_fwd:
/* update 'max seq to be acked' in the other direction so we don't get
* this indication again.
*/
if( tcpd->rev->tcp_analyze_seq_info->maxseqtobeacked > tcpd->rev->tcp_analyze_seq_info->nextseq ) {
if( LT_SEQ(tcpd->rev->tcp_analyze_seq_info->maxseqtobeacked, tcpd->rev->tcp_analyze_seq_info->nextseq) ) {
tcpd->rev->tcp_analyze_seq_info->maxseqtobeacked=tcpd->rev->tcp_analyze_seq_info->nextseq;
tcpd->ta->flags|=TCP_A_ACK_LOST_PACKET;
}