zephyr/subsys/net/lib/sockets
Robert Lubos e5d67adf80 net: sockets: services: Don't modify pollfd array from other threads
pollfd array used with zsock_poll() should not be modified while inside
zsock_poll() function as this could lead to unexpected results. For
instance, k_poll already monitoring some kernel primitive could report
an event, but it will not be processed if the monitored socket file
descriptor in the pollfd array was set to -1. In result,
zsock_poll() may unexpectedly quit prematurely, returning 0 events, even
if it was requested to wait infinitely.

The pollfd arrays used by zsock_poll() (ctx.events) is reinitialized
when the service thread is restarted so modifying it directly when
registering/unregistering service is not really needed. It's enough if
those functions notify the eventfd socket used to restart the services
thread.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
2024-07-09 17:19:12 +02:00
..
CMakeLists.txt Revert "net: sockets: move select() implementation to zvfs" 2024-07-03 15:03:05 -04:00
getaddrinfo.c build: namespace the generated headers with zephyr/ 2024-05-28 22:03:55 +02:00
getnameinfo.c
Kconfig Revert "net: sockets: move poll implementation to zvfs" 2024-07-03 15:03:05 -04:00
socket_dispatcher.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
socket_obj_core.c posix: deprecate POSIX_MAX_FDS and add POSIX_DEVICE_IO 2024-06-04 16:27:12 -05:00
socket_offload.c
socketpair.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
sockets_can.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
sockets_internal.h net: sockets: Refactor accept() to support objcore better 2024-01-17 09:55:40 +01:00
sockets_misc.c build: namespace the generated headers with zephyr/ 2024-05-28 22:03:55 +02:00
sockets_net_mgmt.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
sockets_packet.c fdtable: replace z_ prefix with zvfs_ for fdtable.h functions 2024-06-26 12:33:02 +02:00
sockets_select.c Revert "net: sockets: move select() implementation to zvfs" 2024-07-03 15:03:05 -04:00
sockets_service.c net: sockets: services: Don't modify pollfd array from other threads 2024-07-09 17:19:12 +02:00
sockets_tls.c net: sockets: tls: Fix iov_len comparison in sendmsg() 2024-06-26 12:39:51 +02:00
sockets.c Revert "net: sockets: move poll implementation to zvfs" 2024-07-03 15:03:05 -04:00