This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit cfb7f5d0b5f4243f27bfe4ef655932b541031f38
Author: wenquan1 <[email protected]>
AuthorDate: Mon Sep 29 15:30:27 2025 +0800

    net/tcp: fix window size decrease when receive out-of-order packets
    
    refer to linux implementation, cached out-of-order packets are un-acked, no 
need to sum the size of out-of-order packets to decrease receive window size.
    
    Signed-off-by: wenquan1 <[email protected]>
---
 net/tcp/tcp_recvwindow.c | 30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/net/tcp/tcp_recvwindow.c b/net/tcp/tcp_recvwindow.c
index de609650614..a922ed62419 100644
--- a/net/tcp/tcp_recvwindow.c
+++ b/net/tcp/tcp_recvwindow.c
@@ -221,36 +221,6 @@ uint32_t tcp_get_recvwindow(FAR struct net_driver_s *dev,
 
   recvwndo = tcp_calc_rcvsize(conn, recvwndo);
 
-#ifdef CONFIG_NET_TCP_OUT_OF_ORDER
-  /* Calculate the minimum desired size */
-
-  if (conn->nofosegs > 0)
-    {
-      uint32_t desire = conn->ofosegs[0].left -
-                        tcp_getsequence(conn->rcvseq);
-      int bufsize = tcp_ofoseg_bufsize(conn);
-
-      if (desire < tcp_rx_mss(dev))
-        {
-          desire = tcp_rx_mss(dev);
-        }
-
-      if (TCP_SEQ_LT(recvwndo, bufsize))
-        {
-          recvwndo = 0;
-        }
-      else
-        {
-          recvwndo -= bufsize;
-        }
-
-      if (recvwndo < desire)
-        {
-          recvwndo = desire;
-        }
-    }
-#endif /* CONFIG_NET_TCP_OUT_OF_ORDER */
-
 #ifdef CONFIG_NET_TCP_WINDOW_SCALE
   recvwndo >>= conn->rcv_scale;
 #endif

Reply via email to