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/05 15:20:09 UTC

[GitHub] [incubator-nuttx-apps] XinStellaris commented on pull request #1307: netutils/dhcpc:Make DHCP xid random

XinStellaris commented on PR #1307:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1307#issuecomment-1237198338

   I think we should put it in dhcp request, so that if we keep the dhcpc thread, xid will change every time just like the rfc requested.
   
   
   
   ---Original---
   From: "Xiang ***@***.***&gt;
   Date: Mon, Sep 5, 2022 22:56 PM
   To: ***@***.***&gt;;
   Cc: ***@***.******@***.***&gt;;
   Subject: Re: [apache/incubator-nuttx-apps] netutils/dhcpc:Make DHCP xid random(PR #1307)
   
   
   
   
    
   @xiaoxiang781216 commented on this pull request.
    
    
   In netutils/dhcpc/dhcpc.c:
    &gt; @@ -145,7 +146,7 @@ struct dhcpc_state_s   * Private Data   ****************************************************************************/   -static const uint8_t xid[4] = +static uint8_t xid[4] =  
   let's move xid to the context
    
    
   In netutils/dhcpc/dhcpc.c:
    &gt; @@ -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(&amp;xid, sizeof(xid), 0);  
   move to dhcpc_open
    
   —
   Reply to this email directly, view it on GitHub, or unsubscribe.
   You are receiving this because you authored the thread.Message ID: ***@***.***&gt;


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