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/09/07 11:07:48 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a diff in pull request #1312: netutils/dhcpc:receiving unexpected packet not leading to dhcp retry.

xiaoxiang781216 commented on code in PR #1312:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1312#discussion_r964707301


##########
netutils/dhcpc/dhcpc.c:
##########
@@ -703,6 +705,8 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
    */
 
   retries = 0;
+  last_send = 0;

Review Comment:
   remove last_send



##########
netutils/dhcpc/dhcpc.c:
##########
@@ -720,13 +724,18 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
 
       /* Send the DISCOVER command */
 
-      ninfo("Broadcast DISCOVER\n");
-      if (dhcpc_sendmsg(pdhcpc, presult, DHCPDISCOVER) < 0)
+      if (last_send == 0 ||

Review Comment:
   don't need changedhcp_send since it is impossible to block for long time..



##########
netutils/dhcpc/dhcpc.c:
##########
@@ -767,6 +776,14 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
 
           return ERROR;
         }
+
+      current = clock();
+
+      if (TICK2MSEC(current - last_send) >

Review Comment:
   ```suggestion
         if (TICK2MSEC(clock() - current ) >
   ```



##########
netutils/dhcpc/dhcpc.c:
##########
@@ -783,6 +800,8 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
    */
 
   retries = 0;
+  last_send = 0;

Review Comment:
   apply the same change in following code.



-- 
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