#if TCP_LISTEN_BACKLOG
/* Let the stack know that we have accepted the connection. */
API_MSG_VAR_ALLOC_DONTFAIL(msg);
- API_MSG_VAR_REF(msg).msg.conn = conn;
- /* don't care for the return value of lwip_netconn_do_recv */
- TCPIP_APIMSG_NOERR(&API_MSG_VAR_REF(msg), lwip_netconn_do_recv);
+ API_MSG_VAR_REF(msg).msg.conn = newconn;
+ /* don't care for the return value of lwip_netconn_do_accepted */
+ TCPIP_APIMSG_NOERR(&API_MSG_VAR_REF(msg), lwip_netconn_do_accepted);
API_MSG_VAR_FREE(msg);
#endif /* TCP_LISTEN_BACKLOG */