mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-06 00:39:59 +00:00
Fix bug #46837 Don't send dhcp_release message in dhcp_release function
This commit is contained in:
parent
40ff62fa60
commit
123c8dbd6a
@ -1205,12 +1205,16 @@ dhcp_release(struct netif *netif)
|
|||||||
struct dhcp *dhcp = netif->dhcp;
|
struct dhcp *dhcp = netif->dhcp;
|
||||||
err_t result;
|
err_t result;
|
||||||
ip_addr_t server_ip_addr;
|
ip_addr_t server_ip_addr;
|
||||||
|
u8_t is_dhcp_supplied_address;
|
||||||
|
|
||||||
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_release()\n"));
|
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE, ("dhcp_release()\n"));
|
||||||
if (dhcp == NULL) {
|
if (dhcp == NULL) {
|
||||||
return ERR_ARG;
|
return ERR_ARG;
|
||||||
}
|
}
|
||||||
ip_addr_copy(server_ip_addr, dhcp->server_ip_addr);
|
ip_addr_copy(server_ip_addr, dhcp->server_ip_addr);
|
||||||
|
|
||||||
|
is_dhcp_supplied_address = dhcp_supplied_address(netif);
|
||||||
|
|
||||||
/* idle DHCP client */
|
/* idle DHCP client */
|
||||||
dhcp_set_state(dhcp, DHCP_STATE_OFF);
|
dhcp_set_state(dhcp, DHCP_STATE_OFF);
|
||||||
/* clean old DHCP offer */
|
/* clean old DHCP offer */
|
||||||
@ -1224,7 +1228,7 @@ dhcp_release(struct netif *netif)
|
|||||||
dhcp->offered_t0_lease = dhcp->offered_t1_renew = dhcp->offered_t2_rebind = 0;
|
dhcp->offered_t0_lease = dhcp->offered_t1_renew = dhcp->offered_t2_rebind = 0;
|
||||||
dhcp->t1_renew_time = dhcp->t2_rebind_time = dhcp->lease_used = dhcp->t0_timeout = 0;
|
dhcp->t1_renew_time = dhcp->t2_rebind_time = dhcp->lease_used = dhcp->t0_timeout = 0;
|
||||||
|
|
||||||
if (!dhcp_supplied_address(netif)) {
|
if (!is_dhcp_supplied_address) {
|
||||||
/* don't issue release message when address is not dhcp-assigned */
|
/* don't issue release message when address is not dhcp-assigned */
|
||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user