mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-25 18:14:53 +00:00
dhcp: generate new xid for DHCP release
This commit is contained in:
parent
988ce1e80e
commit
600e248f06
@ -1331,6 +1331,7 @@ dhcp_release_and_stop(struct netif *netif)
|
|||||||
/* create and initialize the DHCP message header */
|
/* create and initialize the DHCP message header */
|
||||||
struct pbuf *p_out;
|
struct pbuf *p_out;
|
||||||
u16_t options_out_len;
|
u16_t options_out_len;
|
||||||
|
dhcp_set_state(dhcp, DHCP_STATE_OFF);
|
||||||
p_out = dhcp_create_msg(netif, dhcp, DHCP_RELEASE, &options_out_len);
|
p_out = dhcp_create_msg(netif, dhcp, DHCP_RELEASE, &options_out_len);
|
||||||
if (p_out != NULL) {
|
if (p_out != NULL) {
|
||||||
struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload;
|
struct dhcp_msg *msg_out = (struct dhcp_msg *)p_out->payload;
|
||||||
@ -1350,10 +1351,10 @@ dhcp_release_and_stop(struct netif *netif)
|
|||||||
|
|
||||||
/* remove IP address from interface (prevents routing from selecting this interface) */
|
/* remove IP address from interface (prevents routing from selecting this interface) */
|
||||||
netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
|
netif_set_addr(netif, IP4_ADDR_ANY4, IP4_ADDR_ANY4, IP4_ADDR_ANY4);
|
||||||
|
} else {
|
||||||
|
dhcp_set_state(dhcp, DHCP_STATE_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
dhcp_set_state(dhcp, DHCP_STATE_OFF);
|
|
||||||
|
|
||||||
if (dhcp->pcb_allocated != 0) {
|
if (dhcp->pcb_allocated != 0) {
|
||||||
dhcp_dec_pcb_refcount(); /* free DHCP PCB if not needed any more */
|
dhcp_dec_pcb_refcount(); /* free DHCP PCB if not needed any more */
|
||||||
dhcp->pcb_allocated = 0;
|
dhcp->pcb_allocated = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user