diff --git a/src/core/tcp.c b/src/core/tcp.c index 3fc5b296..f1ed03a3 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -312,14 +312,7 @@ tcp_listen(struct tcp_pcb *pcb) #if LWIP_CALLBACK_API lpcb->accept = tcp_accept_null; #endif /* LWIP_CALLBACK_API */ -/* workaround for compile error: assignment requires modifiable lvalue in TCP_REG */ -#if LWIP_TCP_REG_COMPILE_ERROR - /* place this pcb at the start the "listening pcbs" list */ - lpcb->next = tcp_listen_pcbs; - tcp_listen_pcbs = lpcb; -#else - TCP_REG((struct tcp_pcb **)&tcp_listen_pcbs, (struct tcp_pcb *)lpcb); -#endif + TCP_REG(&tcp_listen_pcbs, lpcb); return (struct tcp_pcb *)lpcb; } /*-----------------------------------------------------------------------------------*/ diff --git a/src/include/lwip/tcp.h b/src/include/lwip/tcp.h index 821406c5..7b7aa17c 100644 --- a/src/include/lwip/tcp.h +++ b/src/include/lwip/tcp.h @@ -417,6 +417,7 @@ extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */ tcp_tmp_pcb = tcp_tmp_pcb->next) { \ ASSERT("TCP_REG: already registered\n", tcp_tmp_pcb != npcb); \ } \ + /* TODO: state field doesn't exist in listen pcbs */ \ ASSERT("TCP_REG: pcb->state != CLOSED", npcb->state != CLOSED); \ npcb->next = *pcbs; \ ASSERT("TCP_REG: npcb->next != npcb", npcb->next != npcb); \