diff --git a/net/tcp/tcp_recvwindow.c b/net/tcp/tcp_recvwindow.c index 065f368c19..4929e797ee 100644 --- a/net/tcp/tcp_recvwindow.c +++ b/net/tcp/tcp_recvwindow.c @@ -152,9 +152,9 @@ uint16_t tcp_get_recvwindow(FAR struct net_driver_s *dev) */ rwnd = (navail * CONFIG_IOB_BUFSIZE) + mss; - if (rwnd > INT16_MAX) + if (rwnd > UINT16_MAX) { - rwnd = INT16_MAX; + rwnd = UINT16_MAX; } /* Save the new receive window size */