Skip to contentSkip to conversation

selftests/bpf: Fix build of sockmap_ktls.c

PATCH Applied Alexei Starovoitov 3 participants 3 messages Feb 19, 2020 – Feb 20, 2020

Subsystems (5)
lore
Share & tools
lore

Alexei Starovoitov

author maintainer
#0 lore raw

PATCH 1/1 selftests/bpf: Fix build of sockmap_ktls.c

The selftests fails to build with:
tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c: In function ‘test_sockmap_ktls_disconnect_after_delete’:
tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c:72:37: error: ‘TCP_ULP’ undeclared (first use in this function)
72 | err = setsockopt(cli, IPPROTO_TCP, TCP_ULP, "tls", strlen("tls"));
| ^~~~~~~

Similar to commit that fixes build of sockmap_basic.c on systems with old /usr/include fix the build of sockmap_ktls.c

Fixes d1ba1204f2ee ("selftests/bpf: Test unhashing kTLS socket after removing from map")
---
 tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c +1 -0
index 589b50c91b96..06b86addc181 100644
@@ -7,6 +7,7 @@
 #include "test_progs.h"
 
 #define MAX_TEST_NAME 80
+#define TCP_ULP 31
 
 static int tcp_server(int family)
 {
Signature · 1 line
2.23.0
Acked-by on v1 1/1
#1 lore raw
Quoted 30 lines · Alexei Starovoitov

The selftests fails to build with:
tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c: In function ‘test_sockmap_ktls_disconnect_after_delete’:
tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c:72:37: error: ‘TCP_ULP’ undeclared (first use in this function)
72 | err = setsockopt(cli, IPPROTO_TCP, TCP_ULP, "tls", strlen("tls"));
| ^~~~~~~

Similar to commit that fixes build of sockmap_basic.c on systems with old /usr/include fix the build of sockmap_ktls.c

Fixes d1ba1204f2ee ("selftests/bpf: Test unhashing kTLS socket after removing from map")
---
 tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c +1 -0
index 589b50c91b96..06b86addc181 100644
@@ -7,6 +7,7 @@
 #include "test_progs.h"
 
 #define MAX_TEST_NAME 80
+#define TCP_ULP 31
 
 static int tcp_server(int family)
 {
Signature · 1 line
2.23.0

Thanks.

maintainer Applied
#2 lore raw
In reply to Alexei Starovoitov
Quoted 11 lines · Alexei Starovoitov

The selftests fails to build with:
tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c: In function ‘test_sockmap_ktls_disconnect_after_delete’:
tools/testing/selftests/bpf/prog_tests/sockmap_ktls.c:72:37: error: ‘TCP_ULP’ undeclared (first use in this function)

    72 |  err = setsockopt(cli, IPPROTO_TCP, TCP_ULP, "tls", strlen("tls"));
       |                                     ^~~~~~~

Similar to commit that fixes build of sockmap_basic.c on systems with old /usr/include fix the build of sockmap_ktls.c

Fixes d1ba1204f2ee ("selftests/bpf: Test unhashing kTLS socket after removing from map")

Applied, thanks!