Merge branch 'bugfix/fix_lwip_mt' into 'master'

feat(lwip): Fix UDP recv NULL package

See merge request 
This commit is contained in:
Wu Jian Gang
2018-07-06 19:29:57 +08:00
2 changed files with 8 additions and 0 deletions
components/lwip
include/lwip/apps/multi-threads/sys
lwip/src/api

@ -106,6 +106,7 @@ int lwip_fcntl_mt(int s, int cmd, int val);
#define read(a,b,c) lwip_read_mt(a,b,c)
#define write(a,b,c) lwip_write_mt(a,b,c)
#define close(s) lwip_close_mt(s)
#define closesocket(s) lwip_close_mt(s)
#define fcntl(a,b,c) lwip_fcntl_mt(a,b,c)
#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */

@ -571,7 +571,14 @@ netconn_recv_data(struct netconn *conn, void **new_buf)
#endif /* LWIP_TCP && (LWIP_UDP || LWIP_RAW) */
#if (LWIP_UDP || LWIP_RAW)
{
#ifdef SOCKETS_MT
if (!buf) {
API_EVENT(conn, NETCONN_EVT_ERROR, 0);
return ERR_CLSD;
}
#else
LWIP_ASSERT("buf != NULL", buf != NULL);
#endif
len = netbuf_len((struct netbuf*)buf);
}
#endif /* (LWIP_UDP || LWIP_RAW) */