Thread (17 messages) 17 messages, 6 authors, 5d ago

Re: [PATCH bpf v2 3/4] selftests/bpf: Adapt sockmap update error handling

From: Michal Luczaj <hidden>
Date: 2026-06-28 21:59:57
Also in: bpf, linux-kselftest, lkml

On 6/26/26 22:58, Kuniyuki Iwashima wrote:
On Fri, Jun 26, 2026 at 1:37 PM Michal Luczaj [off-list ref] wrote:
quoted
Update sockmap_listen to accommodate the recent change in sockmap that
rejects unbound UDP sockets.

TCP: Reject unbound and bound (unless established or listening).
UDP: Accept only bound sockets.

Signed-off-by: Michal Luczaj <redacted>
---
 tools/testing/selftests/bpf/prog_tests/sockmap_listen.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
index cc0c68bab907..6ee1bc6b3b23 100644
--- a/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
+++ b/tools/testing/selftests/bpf/prog_tests/sockmap_listen.c
@@ -63,11 +63,8 @@ static void test_insert_opened(struct test_sockmap_listen *skel __always_unused,
        errno = 0;
        value = s;
        err = bpf_map_update_elem(mapfd, &key, &value, BPF_NOEXIST);
-       if (sotype == SOCK_STREAM) {
-               if (!err || errno != EOPNOTSUPP)
-                       FAIL_ERRNO("map_update: expected EOPNOTSUPP");
-       } else if (err)
-               FAIL_ERRNO("map_update: expected success");
Initially I thought AF_UNIX still exercised this path but it was removed
in f3de1cf621f7.  The leftover in family_str() was a bit confusing, so please
follow up on bpf-next.
Sure, will do.

thanks,
Michal
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help