Use TCP_RMV instead of tcp_pcb_remove when removing pcbs from tcp_bound_pcbs list (bug introduced while fixing bug #1895)

This commit is contained in:
goldsimon 2007-05-29 11:02:53 +00:00
parent 98df3c6e0a
commit c43ab76bbe

View File

@ -134,7 +134,7 @@ tcp_close(struct tcp_pcb *pcb)
* is erroneous, but this should never happen as the pcb has in those cases * is erroneous, but this should never happen as the pcb has in those cases
* been freed, and so any remaining handles are bogus. */ * been freed, and so any remaining handles are bogus. */
err = ERR_OK; err = ERR_OK;
tcp_pcb_remove(&tcp_bound_pcbs, pcb); TCP_RMV(&tcp_bound_pcbs, pcb);
memp_free(MEMP_TCP_PCB, pcb); memp_free(MEMP_TCP_PCB, pcb);
pcb = NULL; pcb = NULL;
break; break;
@ -333,7 +333,7 @@ tcp_listen(struct tcp_pcb *pcb)
lpcb->ttl = pcb->ttl; lpcb->ttl = pcb->ttl;
lpcb->tos = pcb->tos; lpcb->tos = pcb->tos;
ip_addr_set(&lpcb->local_ip, &pcb->local_ip); ip_addr_set(&lpcb->local_ip, &pcb->local_ip);
tcp_pcb_remove(&tcp_bound_pcbs, pcb); TCP_RMV(&tcp_bound_pcbs, pcb);
memp_free(MEMP_TCP_PCB, pcb); memp_free(MEMP_TCP_PCB, pcb);
#if LWIP_CALLBACK_API #if LWIP_CALLBACK_API
lpcb->accept = tcp_accept_null; lpcb->accept = tcp_accept_null;
@ -459,7 +459,7 @@ tcp_connect(struct tcp_pcb *pcb, struct ip_addr *ipaddr, u16_t port,
#if LWIP_CALLBACK_API #if LWIP_CALLBACK_API
pcb->connected = connected; pcb->connected = connected;
#endif /* LWIP_CALLBACK_API */ #endif /* LWIP_CALLBACK_API */
tcp_pcb_remove(&tcp_bound_pcbs, pcb); TCP_RMV(&tcp_bound_pcbs, pcb);
TCP_REG(&tcp_active_pcbs, pcb); TCP_REG(&tcp_active_pcbs, pcb);
snmp_inc_tcpactiveopens(); snmp_inc_tcpactiveopens();