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

Re: [PATCH bpf v2 4/4] selftests/bpf: Fail unbound UDP on sockmap update

From: Kuniyuki Iwashima <kuniyu@google.com>
Date: 2026-06-26 21:04:07
Also in: bpf, linux-kselftest, lkml

On Fri, Jun 26, 2026 at 1:37 PM Michal Luczaj [off-list ref] wrote:
quoted hunk ↗ jump to hunk
sockmap now rejects unbound UDP sockets. Adjust test_maps.

This effectively reverts commit c39aa2159974 ("bpf, selftests: Fix
test_maps now that sockmap supports UDP").

Signed-off-by: Michal Luczaj <redacted>
---
 tools/testing/selftests/bpf/test_maps.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c
index c32da7bd8be2..81cd5d0d69c1 100644
--- a/tools/testing/selftests/bpf/test_maps.c
+++ b/tools/testing/selftests/bpf/test_maps.c
@@ -759,12 +759,12 @@ static void test_sockmap(unsigned int tasks, void *data)
                goto out_sockmap;
        }

-       /* Test update with unsupported UDP socket */
+       /* Test update with unsupported unbound UDP socket */
        udp = socket(AF_INET, SOCK_DGRAM, 0);
        i = 0;
        err = bpf_map_update_elem(fd, &i, &udp, BPF_ANY);
-       if (err) {
-               printf("Failed socket update SOCK_DGRAM '%i:%i'\n",
+       if (!err) {
+               printf("Failed allowed unbound SOCK_DGRAM socket update '%i:%i'\n",
nit: Maybe s/Failed/Unexpectedly succeeded/ ?

If we want to avoid breakage, this patch needs to be squashed to
the fix patch, but it's discouraged in netdev, not sure about bpf tree.

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help