diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/include/tools/libc_compat.h | 2 | ||||
| -rw-r--r-- | tools/testing/selftests/bpf/test_maps.c | 10 |
2 files changed, 8 insertions, 4 deletions
diff --git a/tools/include/tools/libc_compat.h b/tools/include/tools/libc_compat.h index 664ced8cb1b0..e907ba6f15e5 100644 --- a/tools/include/tools/libc_compat.h +++ b/tools/include/tools/libc_compat.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | // SPDX-License-Identifier: GPL-2.0+ | 1 | // SPDX-License-Identifier: (LGPL-2.0+ OR BSD-2-Clause) |
| 2 | /* Copyright (C) 2018 Netronome Systems, Inc. */ | 2 | /* Copyright (C) 2018 Netronome Systems, Inc. */ |
| 3 | 3 | ||
| 4 | #ifndef __TOOLS_LIBC_COMPAT_H | 4 | #ifndef __TOOLS_LIBC_COMPAT_H |
diff --git a/tools/testing/selftests/bpf/test_maps.c b/tools/testing/selftests/bpf/test_maps.c index 6f54f84144a0..9b552c0fc47d 100644 --- a/tools/testing/selftests/bpf/test_maps.c +++ b/tools/testing/selftests/bpf/test_maps.c | |||
| @@ -580,7 +580,11 @@ static void test_sockmap(int tasks, void *data) | |||
| 580 | /* Test update without programs */ | 580 | /* Test update without programs */ |
| 581 | for (i = 0; i < 6; i++) { | 581 | for (i = 0; i < 6; i++) { |
| 582 | err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_ANY); | 582 | err = bpf_map_update_elem(fd, &i, &sfd[i], BPF_ANY); |
| 583 | if (err) { | 583 | if (i < 2 && !err) { |
| 584 | printf("Allowed update sockmap '%i:%i' not in ESTABLISHED\n", | ||
| 585 | i, sfd[i]); | ||
| 586 | goto out_sockmap; | ||
| 587 | } else if (i >= 2 && err) { | ||
| 584 | printf("Failed noprog update sockmap '%i:%i'\n", | 588 | printf("Failed noprog update sockmap '%i:%i'\n", |
| 585 | i, sfd[i]); | 589 | i, sfd[i]); |
| 586 | goto out_sockmap; | 590 | goto out_sockmap; |
| @@ -741,7 +745,7 @@ static void test_sockmap(int tasks, void *data) | |||
| 741 | } | 745 | } |
| 742 | 746 | ||
| 743 | /* Test map update elem afterwards fd lives in fd and map_fd */ | 747 | /* Test map update elem afterwards fd lives in fd and map_fd */ |
| 744 | for (i = 0; i < 6; i++) { | 748 | for (i = 2; i < 6; i++) { |
| 745 | err = bpf_map_update_elem(map_fd_rx, &i, &sfd[i], BPF_ANY); | 749 | err = bpf_map_update_elem(map_fd_rx, &i, &sfd[i], BPF_ANY); |
| 746 | if (err) { | 750 | if (err) { |
| 747 | printf("Failed map_fd_rx update sockmap %i '%i:%i'\n", | 751 | printf("Failed map_fd_rx update sockmap %i '%i:%i'\n", |
| @@ -845,7 +849,7 @@ static void test_sockmap(int tasks, void *data) | |||
| 845 | } | 849 | } |
| 846 | 850 | ||
| 847 | /* Delete the elems without programs */ | 851 | /* Delete the elems without programs */ |
| 848 | for (i = 0; i < 6; i++) { | 852 | for (i = 2; i < 6; i++) { |
| 849 | err = bpf_map_delete_elem(fd, &i); | 853 | err = bpf_map_delete_elem(fd, &i); |
| 850 | if (err) { | 854 | if (err) { |
| 851 | printf("Failed delete sockmap %i '%i:%i'\n", | 855 | printf("Failed delete sockmap %i '%i:%i'\n", |
