From ae4b5b5f50f28f76feee72df22947d809c29c2b4 Mon Sep 17 00:00:00 2001 From: chao an Date: Mon, 21 Nov 2022 15:27:47 +0800 Subject: [PATCH] net/tcp: TCP_WAITALL should use state flag The feature of MSG_WAITALL is broken since the wrong flag is used Signed-off-by: chao an --- net/tcp/tcp_recvfrom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/tcp/tcp_recvfrom.c b/net/tcp/tcp_recvfrom.c index 5c5bed6299..386687e012 100644 --- a/net/tcp/tcp_recvfrom.c +++ b/net/tcp/tcp_recvfrom.c @@ -402,7 +402,8 @@ static uint16_t tcp_recvhandler(FAR struct net_driver_s *dev, * next receive is performed. */ - if ((pstate->ir_recvlen > 0 && (flags & TCP_WAITALL) == 0) || + if ((pstate->ir_recvlen > 0 && + (pstate->ir_cb->flags & TCP_WAITALL) == 0) || pstate->ir_buflen == 0) { ninfo("TCP resume\n");