Skip to content

Commit 5cebdf5

Browse files
chyu313jukkar
authored andcommitted
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 <[email protected]>
1 parent d48627b commit 5cebdf5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

subsys/net/lib/sockets/sockets_select.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ int zsock_select(int nfds, zsock_fd_set *readfds, zsock_fd_set *writefds,
9292

9393
ored_mask = read_mask | write_mask | except_mask;
9494
if (ored_mask == 0U) {
95+
fd_no += sizeof(ored_mask) * 8;
9596
continue;
9697
}
9798

0 commit comments

Comments
 (0)