Skip to content

Conversation

rlubos
Copy link
Contributor

@rlubos rlubos commented Jul 16, 2024

In case POLLIN is set, and no new application data has been detected, the ztls_poll_update_ctx() should only return -EAGAIN if no other events are available for the socket. Otherwise, the function may end up busy-looping, in case for example POLLOUT is also monitored for the socket.

Current check verifying that was wrong, as it caused to function to return -EAGAIN even if some other events could've been reported for the socket.

Fixes #75909

@rlubos rlubos added the bug The issue is a bug, or the PR is fixing a bug label Jul 16, 2024
In case POLLIN is set, and no new application data has been detected,
the ztls_poll_update_ctx() should only return -EAGAIN if no other events
are available for the socket. Otherwise, the function may end up
busy-looping, in case for example POLLOUT is also monitored for the
socket.

Current check verifying that was wrong, as it caused to function to
return -EAGAIN even if some other events could've been reported for the
socket.

Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
@rlubos rlubos force-pushed the net/dtls-nsos-busy-looping branch from e0274a3 to 5cc5cc5 Compare July 16, 2024 10:41
@nashif nashif added the backport v3.7-branch Request backport to the v3.7-branch label Jul 16, 2024
@nashif nashif added this to the v4.0.0 milestone Jul 18, 2024
@nashif nashif merged commit bfe958a into zephyrproject-rtos:main Jul 27, 2024
@rlubos rlubos deleted the net/dtls-nsos-busy-looping branch April 24, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Networking area: Sockets Networking sockets backport v3.7-branch Request backport to the v3.7-branch bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CONFIG_NET_NATIVE_OFFLOADED_SOCKETS fails after DTLS handshake
5 participants