mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-23 19:20:52 +00:00
Added a function to deallocate the struct dhcp from a netif (fixes bug #31525).
This commit is contained in:
parent
f418782c2c
commit
32f02325f9
@ -13,6 +13,10 @@ HISTORY
|
|||||||
|
|
||||||
++ New features:
|
++ New features:
|
||||||
|
|
||||||
|
2010-06-16: Simon Goldschmidt
|
||||||
|
* dhcp.c/.h: Added a function to deallocate the struct dhcp from a netif
|
||||||
|
(fixes bug #31525).
|
||||||
|
|
||||||
2010-07-12: Simon Goldschmidt (patch by Stephane Lesage)
|
2010-07-12: Simon Goldschmidt (patch by Stephane Lesage)
|
||||||
* ip.c, udp.c/.h, pbuf.h, sockets.c: task #10495: Added support for
|
* ip.c, udp.c/.h, pbuf.h, sockets.c: task #10495: Added support for
|
||||||
IP_MULTICAST_LOOP at socket- and raw-API level.
|
IP_MULTICAST_LOOP at socket- and raw-API level.
|
||||||
|
@ -592,6 +592,23 @@ dhcp_set_struct(struct netif *netif, struct dhcp *dhcp)
|
|||||||
netif->dhcp = dhcp;
|
netif->dhcp = dhcp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Removes a struct dhcp from a netif.
|
||||||
|
*
|
||||||
|
* ATTENTION: Only use this when not using dhcp_set_struct() to allocate the
|
||||||
|
* struct dhcp since the memory is passed back to the heap.
|
||||||
|
*
|
||||||
|
* @param netif the netif from which to remove the struct dhcp
|
||||||
|
*/
|
||||||
|
void dhcp_cleanup(struct netif *netif)
|
||||||
|
{
|
||||||
|
LWIP_ASSERT("netif != NULL", netif != NULL);
|
||||||
|
|
||||||
|
if (netif->dhcp != NULL) {
|
||||||
|
mem_free(netif->dhcp);
|
||||||
|
netif->dhcp = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Start DHCP negotiation for a network interface.
|
* Start DHCP negotiation for a network interface.
|
||||||
*
|
*
|
||||||
|
@ -106,6 +106,9 @@ PACK_STRUCT_END
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void dhcp_set_struct(struct netif *netif, struct dhcp *dhcp);
|
void dhcp_set_struct(struct netif *netif, struct dhcp *dhcp);
|
||||||
|
/** Remove a struct dhcp previously set to the netif using dhcp_set_struct() */
|
||||||
|
#define dhcp_remove_struct(netif) do { (netif)->dhcp = NULL; } while(0)
|
||||||
|
void dhcp_cleanup(struct netif *netif);
|
||||||
/** start DHCP configuration */
|
/** start DHCP configuration */
|
||||||
err_t dhcp_start(struct netif *netif);
|
err_t dhcp_start(struct netif *netif);
|
||||||
/** enforce early lease renewal (not needed normally)*/
|
/** enforce early lease renewal (not needed normally)*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user