mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-27 06:14:09 +00:00
dhcp: generate new xid for DHCP release
This commit is contained in:
parent
dbd0bc8a2c
commit
2e4932f23b
@ -1354,6 +1354,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;
|
||||||
@ -1373,6 +1374,8 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LWIP_DHCP_AUTOIP_COOP
|
#if LWIP_DHCP_AUTOIP_COOP
|
||||||
@ -1382,8 +1385,6 @@ dhcp_release_and_stop(struct netif *netif)
|
|||||||
}
|
}
|
||||||
#endif /* LWIP_DHCP_AUTOIP_COOP */
|
#endif /* LWIP_DHCP_AUTOIP_COOP */
|
||||||
|
|
||||||
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