From accca2add394a95138e3b216d2e3ad417641f05e Mon Sep 17 00:00:00 2001 From: meijian Date: Wed, 20 Nov 2024 16:45:31 +0800 Subject: [PATCH] Revert "net/tcp: no need to set tcp_window_scale opt if window less 65535" Reason for revert: Even if the window size is smaller than 65535 and scale is set, it will not affect the window size setting. --- net/tcp/tcp_send.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/net/tcp/tcp_send.c b/net/tcp/tcp_send.c index c1f89f38ad4..06fb576e0fa 100644 --- a/net/tcp/tcp_send.c +++ b/net/tcp/tcp_send.c @@ -636,13 +636,8 @@ void tcp_synack(FAR struct net_driver_s *dev, FAR struct tcp_conn_s *conn, tcp->optdata[optlen++] = tcp_mss & 0xff; #ifdef CONFIG_NET_TCP_WINDOW_SCALE - if (tcp_get_recvwindow(dev, conn) < UINT16_MAX) - { - conn->rcv_scale = 0; - } - else if (tcp->flags == TCP_SYN || - ((tcp->flags == (TCP_ACK | TCP_SYN)) && - (conn->flags & TCP_WSCALE))) + if (tcp->flags == TCP_SYN || + ((tcp->flags == (TCP_ACK | TCP_SYN)) && (conn->flags & TCP_WSCALE))) { tcp->optdata[optlen++] = TCP_OPT_NOOP; tcp->optdata[optlen++] = TCP_OPT_WS; -- Gitee