xiaoxiang781216 commented on code in PR #1307: URL: https://github.com/apache/incubator-nuttx-apps/pull/1307#discussion_r962985951
########## netutils/dhcpc/dhcpc.c: ########## @@ -665,6 +666,17 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult) int retries; int state; + /* RFC2131: A DHCP client MUST choose 'xid's in such a + * way as to minimize the chance of using an 'xid' identical to one used + * by another client. + */ + + ret = getrandom(&xid, sizeof(xid), 0); Review Comment: move to dhcpc_open ########## netutils/dhcpc/dhcpc.c: ########## @@ -145,7 +146,7 @@ struct dhcpc_state_s * Private Data ****************************************************************************/ -static const uint8_t xid[4] = +static uint8_t xid[4] = Review Comment: let's move xid to the context -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org