patacongo commented on a change in pull request #1054:
URL: https://github.com/apache/incubator-nuttx/pull/1054#discussion_r425782228
##########
File path: net/udp/udp_conn.c
##########
@@ -197,13 +194,27 @@ static FAR struct udp_conn_s *udp_find_conn(uint8_t
domain,
static uint16_t udp_select_port(uint8_t domain, FAR union ip_binding_u *u)
{
+ static uint16_t g_last_udp_port;
uint16_t portno;
+ net_lock();
+
+ /* Generate port base dynamically */
+
+ if (g_last_udp_port == 0)
+ {
+ g_last_udp_port = clock_systime_ticks() % 32000;
+
+ if (g_last_udp_port < 4096)
+ {
+ g_last_udp_port += 4096;
+ }
+ }
Review comment:
Same comment as for TCP above.
----------------------------------------------------------------
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:
[email protected]