fixed bug #22804: dhcp_stop doesn't clear NETIF_FLAG_DHCP (flag now cleared)

This commit is contained in:
goldsimon 2008-04-15 17:24:54 +00:00
parent a9aefcc1be
commit 9ccd31a12e
2 changed files with 9 additions and 0 deletions

View File

@ -22,6 +22,10 @@ HISTORY
++ Bugfixes:
2008-04-15 Simon Goldschmidt
* dhcp.c: fixed bug #22804: dhcp_stop doesn't clear NETIF_FLAG_DHCP
(flag now cleared)
2008-03-27 Simon Goldschmidt
* mem.c, tcpip.c, tcpip.h, opt.h: fixed bug #21433 (Calling mem_free/pbuf_free
from interrupt context isn't safe): set LWIP_USE_HEAP_FROM_INTERRUPT to 1

View File

@ -568,6 +568,8 @@ dhcp_start(struct netif *netif)
LWIP_ERROR("netif != NULL", (netif != NULL), return ERR_ARG;);
dhcp = netif->dhcp;
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE, ("dhcp_start(netif=%p) %c%c%"U16_F"\n", (void*)netif, netif->name[0], netif->name[1], (u16_t)netif->num));
/* Remove the flag that says this netif is handled by DHCP,
it is set when we succeeded starting. */
netif->flags &= ~NETIF_FLAG_DHCP;
/* no DHCP client attached yet? */
@ -609,6 +611,7 @@ dhcp_start(struct netif *netif)
dhcp_stop(netif);
return ERR_MEM;
}
/* Set the flag that says this netif is handled by DHCP. */
netif->flags |= NETIF_FLAG_DHCP;
return result;
}
@ -1063,6 +1066,8 @@ dhcp_stop(struct netif *netif)
{
struct dhcp *dhcp = netif->dhcp;
LWIP_ERROR("dhcp_stop: netif != NULL", (netif != NULL), return;);
/* Remove the flag that says this netif is handled by DHCP. */
netif->flags &= ~NETIF_FLAG_DHCP;
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 3, ("dhcp_stop()\n"));
/* netif is DHCP configured? */