From: Michael Brown Date: Fri, 9 Jan 2026 13:18:20 +0000 (+0000) Subject: [tcp] Discard packets that lie immediately before the receive window X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e557f1ab0e0153cae43391f051947bf06629d2c;p=thirdparty%2Fipxe.git [tcp] Discard packets that lie immediately before the receive window We will currently enqueue (rather than discard) retransmitted packets that lie immediately before the current receive window. These packets will be harmlessly discarded when the receive queue is processed immediately afterwards, but cause confusion when attempting to debug TCP performance issues. Fix by adjusting the comparison so that packets that lie immediately before the receive window will be discarded immediately and never enqueued. Signed-off-by: Michael Brown --- diff --git a/src/net/tcp.c b/src/net/tcp.c index 2a98221f6..d47196ba5 100644 --- a/src/net/tcp.c +++ b/src/net/tcp.c @@ -1317,7 +1317,7 @@ static void tcp_rx_enqueue ( struct tcp_connection *tcp, uint32_t seq, */ if ( ( ! ( tcp->tcp_state & TCP_STATE_RCVD ( TCP_SYN ) ) ) || ( tcp_cmp ( seq, tcp->rcv_ack + tcp->rcv_win ) >= 0 ) || - ( tcp_cmp ( nxt, tcp->rcv_ack ) < 0 ) || + ( tcp_cmp ( nxt, tcp->rcv_ack ) <= 0 ) || ( seq_len == 0 ) ) { free_iob ( iobuf ); return;