dhcpc: under STATE_HAVE_OFFER, dont send DECLINE when offer from same server

Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2023-02-10 10:52:40 +08:00 committed by Xiang Xiao
parent 1927f8060c
commit 96956ba83c

View File

@ -860,7 +860,8 @@ int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult)
* that we requested from.
*/
else if (msgtype == DHCPOFFER)
else if (msgtype == DHCPOFFER &&
pdhcpc->serverid.s_addr != presult->serverid.s_addr)
{
ninfo("Received another OFFER, send DECLINE\n");
dhcpc_sendmsg(pdhcpc, presult, DHCPDECLINE);