summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/freplace_connect4.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2020-04-24 18:26:14 -0700
committerDavid S. Miller <davem@davemloft.net>2020-04-24 18:26:14 -0700
commit167ff131cb3dffccab8bb4d65a8d72e7c5ffc398 (patch)
tree4e1748d884532e9386371f9636f52db61eea9d79 /tools/testing/selftests/bpf/progs/freplace_connect4.c
parent3554e54a46125030c534820c297ed7f6c3907e24 (diff)
parente1cebd841b0aa1ceda771706d54a0501986a3c88 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf
Alexei Starovoitov says: ==================== pull-request: bpf 2020-04-24 The following pull-request contains BPF updates for your *net* tree. We've added 17 non-merge commits during the last 5 day(s) which contain a total of 19 files changed, 203 insertions(+), 85 deletions(-). The main changes are: 1) link_update fix, from Andrii. 2) libbpf get_xdp_id fix, from David. 3) xadd verifier fix, from Jann. 4) x86-32 JIT fixes, from Luke and Wang. 5) test_btf fix, from Stanislav. 6) freplace verifier fix, from Toke. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
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";