diff --git a/net/sixlowpan/sixlowpan_tcpsend.c b/net/sixlowpan/sixlowpan_tcpsend.c index ddc34da3a39..b0b0277f8ba 100644 --- a/net/sixlowpan/sixlowpan_tcpsend.c +++ b/net/sixlowpan/sixlowpan_tcpsend.c @@ -446,14 +446,14 @@ static uint16_t tcp_send_eventhandler(FAR struct net_driver_s *dev, sndlen = conn->mss; } - winleft = conn->winsize - sinfo->s_sent + sinfo->s_acked; + winleft = conn->snd_wnd - sinfo->s_sent + sinfo->s_acked; if (sndlen > winleft) { sndlen = winleft; } - ninfo("s_buflen=%zu s_sent=%zu mss=%u winsize=%u sndlen=%d\n", - sinfo->s_buflen, sinfo->s_sent, conn->mss, conn->winsize, + ninfo("s_buflen=%zu s_sent=%zu mss=%u snd_wnd=%u sndlen=%d\n", + sinfo->s_buflen, sinfo->s_sent, conn->mss, conn->snd_wnd, sndlen); if (sndlen > 0) diff --git a/net/tcp/tcp.h b/net/tcp/tcp.h index 9dd9f0c924a..fc67f45f213 100644 --- a/net/tcp/tcp.h +++ b/net/tcp/tcp.h @@ -192,7 +192,8 @@ struct tcp_conn_s uint16_t rport; /* The remoteTCP port, in network byte order */ uint16_t mss; /* Current maximum segment size for the * connection */ - uint16_t winsize; /* Current window size of the connection */ + uint16_t snd_wnd; /* Sequence and acknowledgement numbers of last + * window update */ #ifdef CONFIG_NET_TCP_WRITE_BUFFERS uint32_t tx_unacked; /* Number bytes sent but not yet ACKed */ #else diff --git a/net/tcp/tcp_input.c b/net/tcp/tcp_input.c index bd6455ab3eb..c7055a37704 100644 --- a/net/tcp/tcp_input.c +++ b/net/tcp/tcp_input.c @@ -326,7 +326,7 @@ found: /* Update the connection's window size */ - conn->winsize = ((uint16_t)tcp->wnd[0] << 8) + (uint16_t)tcp->wnd[1]; + conn->snd_wnd = ((uint16_t)tcp->wnd[0] << 8) + (uint16_t)tcp->wnd[1]; flags = 0; diff --git a/net/tcp/tcp_send_buffered.c b/net/tcp/tcp_send_buffered.c index 981b2f80239..51c36a6ef67 100644 --- a/net/tcp/tcp_send_buffered.c +++ b/net/tcp/tcp_send_buffered.c @@ -734,7 +734,7 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev, if ((conn->tcpstateflags & TCP_ESTABLISHED) && (flags & (TCP_POLL | TCP_REXMIT)) && !(sq_empty(&conn->write_q)) && - conn->winsize > 0) + conn->snd_wnd > 0) { FAR struct tcp_wrbuffer_s *wrb; uint32_t predicted_seqno; @@ -760,15 +760,15 @@ static uint16_t psock_send_eventhandler(FAR struct net_driver_s *dev, sndlen = conn->mss; } - if (sndlen > conn->winsize) + if (sndlen > conn->snd_wnd) { - sndlen = conn->winsize; + sndlen = conn->snd_wnd; } ninfo("SEND: wrb=%p pktlen=%u sent=%u sndlen=%zu mss=%u " - "winsize=%u\n", + "snd_wnd=%u\n", wrb, TCP_WBPKTLEN(wrb), TCP_WBSENT(wrb), sndlen, conn->mss, - conn->winsize); + conn->snd_wnd); /* Set the sequence number for this segment. If we are * retransmitting, then the sequence number will already diff --git a/net/tcp/tcp_send_unbuffered.c b/net/tcp/tcp_send_unbuffered.c index abdd11decb6..387f3c78d08 100644 --- a/net/tcp/tcp_send_unbuffered.c +++ b/net/tcp/tcp_send_unbuffered.c @@ -417,7 +417,7 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev, /* Check if we have "space" in the window */ - if ((pstate->snd_sent - pstate->snd_acked + sndlen) < conn->winsize) + if ((pstate->snd_sent - pstate->snd_acked + sndlen) < conn->snd_wnd) { /* Set the sequence number for this packet. NOTE: The network * updates sndseq on receipt of ACK *before* this function is diff --git a/net/tcp/tcp_sendfile.c b/net/tcp/tcp_sendfile.c index 8c84334b520..6792e9cc2c3 100644 --- a/net/tcp/tcp_sendfile.c +++ b/net/tcp/tcp_sendfile.c @@ -299,7 +299,7 @@ static uint16_t sendfile_eventhandler(FAR struct net_driver_s *dev, /* Check if we have "space" in the window */ - if ((pstate->snd_sent - pstate->snd_acked + sndlen) < conn->winsize) + if ((pstate->snd_sent - pstate->snd_acked + sndlen) < conn->snd_wnd) { uint32_t seqno;