Hello everyone, While I am still tracking down various issues regarding networking with NuttX, I observed something interesting within the DHCP client code.
When dhcpc_request is called, the current IP address is set to INADDR_ANY. This is in file dhcpc.c, line 714. This sounds normal for the initial request. But what about when renewing the lease? In this case the system already has a perfectly valid IP address. Setting the interface back to INADDR_ANY, even temporarily, can cause problems to other tasks than may be using the same NIC simultaneously. If another task tries any communication during the DHCP renewal, it fails. I don't think that there is an actual need for it to fail. Also, I believe that setting the address to INADDR_ANY does not benefit DHCP, as it is not using the current IP address in any way (it broadcasts only). I am very tempted to remove this from the DHCP client. Unless I am missing something?