summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/freplace_connect4.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-27 09:33:21 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-27 09:33:21 +0200
commite947861d0ccbc765af4512a395251e6af6857600 (patch)
treee2b8d646f40016e887162bcaf53859edaae15bc9 /tools/testing/selftests/bpf/progs/freplace_connect4.c
parent6f1c0268a4871a80c0ec78142eeb1fe0556e898a (diff)
parent6a8b55ed4056ea5559ebe4f6a4b247f627870d4c (diff)
downloadlwn-e947861d0ccbc765af4512a395251e6af6857600.tar.gz
lwn-e947861d0ccbc765af4512a395251e6af6857600.zip
Merge 5.7-rc3 into tty-next
We need the tty/serial fixes in here too. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/testing/selftests/bpf/progs/freplace_connect4.c')
-rw-r--r--tools/testing/selftests/bpf/progs/freplace_connect4.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/freplace_connect4.c b/tools/testing/selftests/bpf/progs/freplace_connect4.c
new file mode 100644
index 000000000000..a0ae84230699
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/freplace_connect4.c
@@ -0,0 +1,18 @@
+#include <linux/stddef.h>
+#include <linux/ipv6.h>
+#include <linux/bpf.h>
+#include <linux/in.h>
+#include <sys/socket.h>
+#include <bpf/bpf_helpers.h>
+#include <bpf/bpf_endian.h>
+
+SEC("freplace/do_bind")
+int new_do_bind(struct bpf_sock_addr *ctx)
+{
+ struct sockaddr_in sa = {};
+
+ bpf_bind(ctx, (struct sockaddr *)&sa, sizeof(sa));
+ return 0;
+}
+
+char _license[] SEC("license") = "GPL";