Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by Omokefe Emmanuel Onanaroghene
Fri, 20 Nov 2026 06:58
[PATCH net-next] selftests: net: reuseport_addr_any: report epoll_wait timeouts honestly
Author: Omokefe Emmanuel Onanaroghene
Date: Fri, 20 Nov 2026 06:58
Date: Fri, 20 Nov 2026 06:58
28 lines
11699 bytes
11699 bytes
receive_once() waits 3ms for a packet but only checks for errors
(i < 0). On timeout (i == 0) it falls through and uses ev.data.fd
uninitialized. recv() on a garbage fd fails with a misleading
"failed to recv" (or worse, blocks or returns a bogus fd). Report
the timeout for what it is; errnum 0, since epoll_wait sets no
errno on timeout.
Signed-off-by: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>
---
tools/testing/selftests/net/reuseport_addr_any.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/testing/selftests/net/reuseport_addr_any.c b/tools/testing/selftests/net/reuseport_addr_any.c
index 1c43401a1c807..2e8aa83f68dd0 100644
--- a/tools/testing/selftests/net/reuseport_addr_any.c
+++ b/tools/testing/selftests/net/reuseport_addr_any.c
@@ -155,6 +155,8 @@ static int receive_once(int epfd, int proto)
i = epoll_wait(epfd, &ev, 1, 3);
if (i < 0)
error(1, errno, "epoll_wait failed");
+ if (i == 0)
+ error(1, 0, "epoll_wait timed out waiting for packet");
if (proto == SOCK_STREAM) {
fd = accept(ev.data.fd, NULL, NULL);
--
2.43.0
Re: [PATCH net-next] selftests: net: reuseport_addr_any: report epoll_wait timeouts honestly
Author: Hangbin Liu
Date: Mon, 23 Nov 2026 05:38
Date: Mon, 23 Nov 2026 05:38
32 lines
9601 bytes
9601 bytes
On Fri, Nov 20, 2026 at 07:58:55AM +0100, Omokefe Emmanuel Onanaroghene wrote:
> receive_once() waits 3ms for a packet but only checks for errors
> (i < 0). On timeout (i == 0) it falls through and uses ev.data.fd
> uninitialized. recv() on a garbage fd fails with a misleading
> "failed to recv" (or worse, blocks or returns a bogus fd). Report
> the timeout for what it is; errnum 0, since epoll_wait sets no
> errno on timeout.
>
> Signed-off-by: Omokefe Emmanuel Onanaroghene <emmaonana18@gmail.com>
> ---
> tools/testing/selftests/net/reuseport_addr_any.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/testing/selftests/net/reuseport_addr_any.c b/tools/testing/selftests/net/reuseport_addr_any.c
> index 1c43401a1c807..2e8aa83f68dd0 100644
> --- a/tools/testing/selftests/net/reuseport_addr_any.c
> +++ b/tools/testing/selftests/net/reuseport_addr_any.c
> @@ -155,6 +155,8 @@ static int receive_once(int epfd, int proto)
> i = epoll_wait(epfd, &ev, 1, 3);
> if (i < 0)
> error(1, errno, "epoll_wait failed");
> + if (i == 0)
> + error(1, 0, "epoll_wait timed out waiting for packet");
>
> if (proto == SOCK_STREAM) {
> fd = accept(ev.data.fd, NULL, NULL);
> --
> 2.43.0
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Re: [PATCH net-next] selftests: net: reuseport_addr_any: report epoll_wait timeouts honestly
Author: patchwork-bot+netdevbpf
Date: Thu, 26 Nov 2026 02:30
Date: Thu, 26 Nov 2026 02:30
24 lines
8689 bytes
8689 bytes
Hello:
This patch was applied to netdev/net-next.git (main)
by Willem de Bruijn <willemb@google.com>:
On Fri, 20 Nov 2026 07:58:55 +0100 you wrote:
> receive_once() waits 3ms for a packet but only checks for errors
> (i < 0). On timeout (i == 0) it falls through and uses ev.data.fd
> uninitialized. recv() on a garbage fd fails with a misleading
> "failed to recv" (or worse, blocks or returns a bogus fd). Report
> the timeout for what it is; errnum 0, since epoll_wait sets no
> errno on timeout.
>
> [...]
Here is the summary with links:
- [net-next] selftests: net: reuseport_addr_any: report epoll_wait timeouts honestly
https://git.kernel.org/netdev/net-next/c/9a3d44e379b6
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads