From f36448b47862f6be065d1ef354e03d2c13730a57 Mon Sep 17 00:00:00 2001 From: Chih Hung Yu Date: Wed, 28 Apr 2021 18:18:25 +0800 Subject: [PATCH] net: lib: sockets: Fix zsock_select zsock_select() cannot poll file descriptors with number >= 32. When a whole word in FD_SET was skipped due to being empty, corresponding fd number was not updated, leading to wrong fd's being passed to poll(). Fixes #34563 Signed-off-by: Chih Hung Yu --- subsys/net/lib/sockets/sockets_select.c | 1 + 1 file changed, 1 insertion(+) diff --git a/subsys/net/lib/sockets/sockets_select.c b/subsys/net/lib/sockets/sockets_select.c index a76c3f7f31e0a3..ff334ce6045929 100644 --- a/subsys/net/lib/sockets/sockets_select.c +++ b/subsys/net/lib/sockets/sockets_select.c @@ -92,6 +92,7 @@ int zsock_select(int nfds, zsock_fd_set *readfds, zsock_fd_set *writefds, ored_mask = read_mask | write_mask | except_mask; if (ored_mask == 0U) { + fd_no += sizeof(ored_mask) * 8; continue; }