aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/bpf/test_sockmap.c
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2018-10-16 15:59:36 +0200
committerAlexei Starovoitov <ast@kernel.org>2018-10-16 08:10:01 -0700
commit421f4292f46e871cdcf8bdc3e6fdfcefe2e81a9d (patch)
treee007b489a219df2e151ae11855bdea6d88f2be92 /tools/testing/selftests/bpf/test_sockmap.c
parentMerge branch 'net-Kernel-side-filtering-for-route-dumps' (diff)
downloadwireguard-linux-421f4292f46e871cdcf8bdc3e6fdfcefe2e81a9d.tar.xz
wireguard-linux-421f4292f46e871cdcf8bdc3e6fdfcefe2e81a9d.zip
bpf, tls: add tls header to tools infrastructure
Andrey reported a build error for the BPF kselftest suite when compiled on a machine which does not have tls related header bits installed natively: test_sockmap.c:120:23: fatal error: linux/tls.h: No such file or directory #include <linux/tls.h> ^ compilation terminated. Fix it by adding the header to the tools include infrastructure and add definitions such as SOL_TLS that could potentially be missing. Fixes: e9dd904708c4 ("bpf: add tls support for testing in test_sockmap") Reported-by: Andrey Ignatov <rdna@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/test_sockmap.c')
-rw-r--r--tools/testing/selftests/bpf/test_sockmap.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/testing/selftests/bpf/test_sockmap.c b/tools/testing/selftests/bpf/test_sockmap.c
index 10a5fa83c75a..7cb69ce6dfa2 100644
--- a/tools/testing/selftests/bpf/test_sockmap.c
+++ b/tools/testing/selftests/bpf/test_sockmap.c
@@ -28,6 +28,7 @@
#include <linux/sock_diag.h>
#include <linux/bpf.h>
#include <linux/if_link.h>
+#include <linux/tls.h>
#include <assert.h>
#include <libgen.h>
@@ -43,6 +44,13 @@
int running;
static void running_handler(int a);
+#ifndef TCP_ULP
+# define TCP_ULP 31
+#endif
+#ifndef SOL_TLS
+# define SOL_TLS 282
+#endif
+
/* randomly selected ports for testing on lo */
#define S1_PORT 10000
#define S2_PORT 10001
@@ -114,11 +122,6 @@ static void usage(char *argv[])
printf("\n");
}
-#define TCP_ULP 31
-#define TLS_TX 1
-#define TLS_RX 2
-#include <linux/tls.h>
-
char *sock_to_string(int s)
{
if (s == c1)