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 <[email protected]>
---
 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",
                       i, udp);
                goto out_sockmap;
        }

-- 
2.54.0


Reply via email to