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 dc7e529c41c27d3301e011eaa709d0fbdddadac2
Author: raiden00pl <[email protected]>
AuthorDate: Thu Oct 22 15:23:42 2026 +0200

    net/sixlowpan: advance the TCP send sequence past the sent segment
    
    The send sequence was left at the start of the segment just sent, so
    without TCP write buffers an ACK of the whole segment acknowledged data
    not yet sent and was answered with a bare ACK instead of being counted,
    and with write buffers sndseq_max was computed from the unacknowledged
    byte count and overshot with two segments in flight.
    
    Assisted-by: Claude Code
    Signed-off-by: raiden00pl <[email protected]>
---
 net/sixlowpan/sixlowpan_tcpsend.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/net/sixlowpan/sixlowpan_tcpsend.c 
b/net/sixlowpan/sixlowpan_tcpsend.c
index 07cf1e2baff..75a367cc83a 100644
--- a/net/sixlowpan/sixlowpan_tcpsend.c
+++ b/net/sixlowpan/sixlowpan_tcpsend.c
@@ -477,15 +477,21 @@ static uint32_t tcp_send_eventhandler(FAR struct 
net_driver_s *dev,
             }
 
           /* Increment the count of bytes sent and the total count of TCP
-           * packets sent.
+           * packets sent, and advance the send sequence past the segment
+           * like tcp_appsend() does, so that an ACK of it is not one of
+           * data not yet sent.
            */
 
           sinfo->s_sent += sndlen;
+          tcp_setsequence(conn->sndseq, seqno + sndlen);
 
 #ifdef CONFIG_NET_TCP_WRITE_BUFFERS
           /* For compatibility with buffered send logic */
 
-          conn->sndseq_max = tcp_addsequence(conn->sndseq, conn->tx_unacked);
+          if (TCP_SEQ_GT(seqno + sndlen, conn->sndseq_max))
+            {
+              conn->sndseq_max = seqno + sndlen;
+            }
 #endif
 
 #ifdef CONFIG_NET_STATISTICS

Reply via email to