mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
net/tcp: Initialize the sndseq_max.
Initialize conn->sndseq_max when tcp conn alloc Signed-off-by: liqinhui <liqinhui@xiaomi.com>
This commit is contained in:
+8
-7
@@ -1153,7 +1153,7 @@ FAR struct tcp_conn_s *tcp_alloc_accept(FAR struct net_driver_s *dev,
|
||||
conn->expired = 0;
|
||||
conn->isn = 0;
|
||||
conn->sent = 0;
|
||||
conn->sndseq_max = 0;
|
||||
conn->sndseq_max = tcp_getsequence(conn->sndseq);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_NET_TCP_CC_NEWRENO
|
||||
@@ -1456,17 +1456,18 @@ int tcp_connect(FAR struct tcp_conn_s *conn, FAR const struct sockaddr *addr)
|
||||
conn->sa = 0;
|
||||
conn->sv = 16; /* Initial value of the RTT variance. */
|
||||
conn->lport = (uint16_t)port;
|
||||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||
conn->expired = 0;
|
||||
conn->isn = 0;
|
||||
conn->sent = 0;
|
||||
conn->sndseq_max = 0;
|
||||
#endif
|
||||
|
||||
/* Set initial sndseq when we have both local/remote addr and port */
|
||||
|
||||
tcp_initsequence(conn);
|
||||
|
||||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||
conn->expired = 0;
|
||||
conn->isn = 0;
|
||||
conn->sent = 0;
|
||||
conn->sndseq_max = tcp_getsequence(conn->sndseq);
|
||||
#endif
|
||||
|
||||
/* Save initial sndseq to rexmit_seq, otherwise it will be zero */
|
||||
|
||||
#if !defined(CONFIG_NET_TCP_WRITE_BUFFERS)
|
||||
|
||||
Reference in New Issue
Block a user