fixed bug #24480 (releasing old udp_pdb and pbuf in dhcp_start)

This commit is contained in:
goldsimon 2009-02-11 20:27:00 +00:00
parent f9bd5019fa
commit 6472e3b35e
2 changed files with 14 additions and 7 deletions

View File

@ -60,6 +60,9 @@ HISTORY
++ Bugfixes: ++ Bugfixes:
2009-02-11 Simon Goldschmidt
* dhcp.c: fixed bug #24480 (releasing old udp_pdb and pbuf in dhcp_start)
2009-02-11 Simon Goldschmidt 2009-02-11 Simon Goldschmidt
* opt.h, api_msg.c: added configurable default valud for netconn->recv_bufsize: * opt.h, api_msg.c: added configurable default valud for netconn->recv_bufsize:
RECV_BUFSIZE_DEFAULT (fixes bug #23726: pbuf pool exhaustion on slow recv()) RECV_BUFSIZE_DEFAULT (fixes bug #23726: pbuf pool exhaustion on slow recv())

View File

@ -586,6 +586,12 @@ dhcp_start(struct netif *netif)
/* already has DHCP client attached */ /* already has DHCP client attached */
} else { } else {
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 3, ("dhcp_start(): restarting DHCP configuration\n")); LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_STATE | 3, ("dhcp_start(): restarting DHCP configuration\n"));
if (dhcp->pcb != NULL) {
udp_remove(dhcp->pcb);
}
if (dhcp->p != NULL) {
pbuf_free(dhcp->p);
}
} }
/* clear data structure */ /* clear data structure */
@ -671,7 +677,6 @@ dhcp_inform(struct netif *netif)
LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_inform: could not allocate DHCP request\n")); LWIP_DEBUGF(DHCP_DEBUG | LWIP_DBG_TRACE | 2, ("dhcp_inform: could not allocate DHCP request\n"));
} }
if (dhcp != NULL) {
if (dhcp->pcb != NULL) { if (dhcp->pcb != NULL) {
udp_remove(dhcp->pcb); udp_remove(dhcp->pcb);
} }
@ -679,7 +684,6 @@ dhcp_inform(struct netif *netif)
mem_free((void *)dhcp); mem_free((void *)dhcp);
netif->dhcp = old_dhcp; netif->dhcp = old_dhcp;
} }
}
#if DHCP_DOES_ARP_CHECK #if DHCP_DOES_ARP_CHECK
/** /**