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 2021/06/07 07:50:33 UTC
[GitHub] [incubator-nuttx] yamt opened a new pull request #3865: Fix tcp seq wraparoud issues
yamt opened a new pull request #3865:
URL: https://github.com/apache/incubator-nuttx/pull/3865
## Summary
## Impact
## Testing
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] yamt commented on a change in pull request #3865: Fix tcp seq wrap around issues
Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #3865:
URL: https://github.com/apache/incubator-nuttx/pull/3865#discussion_r648051538
##########
File path: net/tcp/tcp.h
##########
@@ -86,6 +86,15 @@
# endif
#endif
+/* 32-bit modular arithmetics for tcp sequence numbers */
+
+#define TCP_SEQ_LT(a, b) ((int32_t)((a) - (b)) < 0)
+#define TCP_SEQ_GT(a, b) TCP_SEQ_LT(b, a)
+#define TCP_SEQ_LTE(a, b) !TCP_SEQ_GT(a, b)
+#define TCP_SEQ_GTE(a, b) !TCP_SEQ_LT(a, b)
Review comment:
done
##########
File path: net/tcp/tcp.h
##########
@@ -86,6 +86,15 @@
# endif
#endif
+/* 32-bit modular arithmetics for tcp sequence numbers */
+
+#define TCP_SEQ_LT(a, b) ((int32_t)((a) - (b)) < 0)
+#define TCP_SEQ_GT(a, b) TCP_SEQ_LT(b, a)
+#define TCP_SEQ_LTE(a, b) !TCP_SEQ_GT(a, b)
Review comment:
done
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] yamt commented on a change in pull request #3865: Fix tcp seq wrap around issues
Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #3865:
URL: https://github.com/apache/incubator-nuttx/pull/3865#discussion_r646988979
##########
File path: net/tcp/tcp.h
##########
@@ -86,6 +86,15 @@
# endif
#endif
+/* 32-bit modular arithmetics for tcp sequence numbers */
+
+#define TCP_SEQ_LT(a, b) ((int32_t)((a) - (b)) < 0)
+#define TCP_SEQ_GT(a, b) TCP_SEQ_LT(b, a)
+#define TCP_SEQ_LTE(a, b) !TCP_SEQ_GT(a, b)
+#define TCP_SEQ_GTE(a, b) !TCP_SEQ_LT(a, b)
Review comment:
ok
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] yamt commented on a change in pull request #3865: Fix tcp seq wrap around issues
Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #3865:
URL: https://github.com/apache/incubator-nuttx/pull/3865#discussion_r646988874
##########
File path: net/tcp/tcp.h
##########
@@ -86,6 +86,15 @@
# endif
#endif
+/* 32-bit modular arithmetics for tcp sequence numbers */
+
+#define TCP_SEQ_LT(a, b) ((int32_t)((a) - (b)) < 0)
+#define TCP_SEQ_GT(a, b) TCP_SEQ_LT(b, a)
+#define TCP_SEQ_LTE(a, b) !TCP_SEQ_GT(a, b)
Review comment:
ok
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #3865: Fix tcp seq wrap around issues
Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #3865:
URL: https://github.com/apache/incubator-nuttx/pull/3865
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [incubator-nuttx] hartmannathan commented on a change in pull request #3865: Fix tcp seq wrap around issues
Posted by GitBox <gi...@apache.org>.
hartmannathan commented on a change in pull request #3865:
URL: https://github.com/apache/incubator-nuttx/pull/3865#discussion_r646830480
##########
File path: net/tcp/tcp.h
##########
@@ -86,6 +86,15 @@
# endif
#endif
+/* 32-bit modular arithmetics for tcp sequence numbers */
+
+#define TCP_SEQ_LT(a, b) ((int32_t)((a) - (b)) < 0)
+#define TCP_SEQ_GT(a, b) TCP_SEQ_LT(b, a)
+#define TCP_SEQ_LTE(a, b) !TCP_SEQ_GT(a, b)
Review comment:
May I suggest:
`#define TCP_SEQ_LTE(a, b) (!TCP_SEQ_GT(a, b))`
(Added parenthesis around the definition.)
##########
File path: net/tcp/tcp.h
##########
@@ -86,6 +86,15 @@
# endif
#endif
+/* 32-bit modular arithmetics for tcp sequence numbers */
+
+#define TCP_SEQ_LT(a, b) ((int32_t)((a) - (b)) < 0)
+#define TCP_SEQ_GT(a, b) TCP_SEQ_LT(b, a)
+#define TCP_SEQ_LTE(a, b) !TCP_SEQ_GT(a, b)
+#define TCP_SEQ_GTE(a, b) !TCP_SEQ_LT(a, b)
Review comment:
Same suggestion here:
`#define TCP_SEQ_GTE(a, b) (!TCP_SEQ_LT(a, b))`
(Added parenthesis.)
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org