From 9ccd31a12e0a7f58a54d6422fc16db48c5cbf854 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 15 Apr 2008 17:24:54 +0000 Subject: [PATCH] fixed bug #22804: dhcp_stop doesn't clear NETIF_FLAG_DHCP (flag now cleared) --- CHANGELOG | 4 ++++ src/core/dhcp.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 642c415d..7382d78a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/src/core/dhcp.c b/src/core/dhcp.c index e86060cf..8eb27838 100644 --- a/src/core/dhcp.c +++ b/src/core/dhcp.c @@ -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? */