You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/02 19:55:42 UTC

[GitHub] [incubator-nuttx] acassis commented on a diff in pull request #7510: net/tcp: Avoid starting TCP sequence number and ack number from 0

acassis commented on code in PR #7510:
URL: https://github.com/apache/incubator-nuttx/pull/7510#discussion_r1012238695


##########
net/tcp/tcp_seqno.c:
##########
@@ -142,6 +143,31 @@ uint32_t tcp_addsequence(FAR uint8_t *seqno, uint16_t len)
 
 void tcp_initsequence(FAR uint8_t *seqno)
 {
+  int ret;
+
+  /* Get a random TCP sequence number */
+
+  ret = getrandom(&g_tcpsequence, sizeof(uint32_t) - 1, 0);

Review Comment:
   Because I'm ++g_tcpsequence to avoid g_tcpsequence == 0



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org