api_msg: Use lwip_netconn_is_err_msg instead of NULL test in netconn_drain()

The NULL test no longer work after commit e0a2472706, it needs to test with
lwip_netconn_is_err_msg() instead.

Fixes: e0a2472706 ("netconn/sockets: remove fatal error handling, fix asynchronous error handling, ensure data before RST can be received")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
Axel Lin 2017-04-17 20:41:13 +08:00 committed by goldsimon
parent f28c1c851b
commit 0b2a652317

View File

@ -816,7 +816,8 @@ netconn_drain(struct netconn *conn)
while (sys_mbox_tryfetch(&conn->recvmbox, &mem) != SYS_MBOX_EMPTY) {
#if LWIP_TCP
if (NETCONNTYPE_GROUP(conn->type) == NETCONN_TCP) {
if (mem != NULL) {
err_t err;
if (lwip_netconn_is_err_msg(mem, &err) == 0) {
p = (struct pbuf*)mem;
/* pcb might be set to NULL already by err_tcp() */
if (conn->pcb.tcp != NULL) {