aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/bpf/bpf_helpers.h
diff options
context:
space:
mode:
authorMartin KaFai Lau <kafai@fb.com>2019-03-12 10:23:11 -0700
committerAlexei Starovoitov <ast@kernel.org>2019-03-13 12:04:35 -0700
commit7681e7b2fbe2a78806423810c0d84dd230b96f94 (patch)
tree31578584bffd05a9c77b22211ec37e648f113a40 /tools/testing/selftests/bpf/bpf_helpers.h
parentbpf: Test ref release issue in bpf_tcp_sock and bpf_sk_fullsock (diff)
downloadwireguard-linux-7681e7b2fbe2a78806423810c0d84dd230b96f94.tar.xz
wireguard-linux-7681e7b2fbe2a78806423810c0d84dd230b96f94.zip
bpf: Add an example for bpf_get_listener_sock
This patch adds an example in using the new helper bpf_get_listener_sock(). Signed-off-by: Martin KaFai Lau <kafai@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_helpers.h')
-rw-r--r--tools/testing/selftests/bpf/bpf_helpers.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/bpf_helpers.h b/tools/testing/selftests/bpf/bpf_helpers.h
index c9433a496d54..c81fc350f7ad 100644
--- a/tools/testing/selftests/bpf/bpf_helpers.h
+++ b/tools/testing/selftests/bpf/bpf_helpers.h
@@ -180,6 +180,8 @@ static struct bpf_sock *(*bpf_sk_fullsock)(struct bpf_sock *sk) =
(void *) BPF_FUNC_sk_fullsock;
static struct bpf_tcp_sock *(*bpf_tcp_sock)(struct bpf_sock *sk) =
(void *) BPF_FUNC_tcp_sock;
+static struct bpf_sock *(*bpf_get_listener_sock)(struct bpf_sock *sk) =
+ (void *) BPF_FUNC_get_listener_sock;
static int (*bpf_skb_ecn_set_ce)(void *ctx) =
(void *) BPF_FUNC_skb_ecn_set_ce;