diff options
author | Mickaël Salaün <mic@digikod.net> | 2017-02-10 00:21:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-10 15:56:06 -0500 |
commit | 2ee89fb9a942e250b5adb5535de4acca14bb7fa2 (patch) | |
tree | a2a05ae382318bb1a863aa8afee37055409e521c /tools/testing/selftests/bpf/test_verifier.c | |
parent | d02d8986a7688d3f0ff6ef61aa6beb41427692eb (diff) |
bpf: Use bpf_load_program() from the library
Replace bpf_prog_load() with bpf_load_program() calls.
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Cc: Alexei Starovoitov <ast@fb.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>
Cc: Shuah Khan <shuah@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'tools/testing/selftests/bpf/test_verifier.c')
-rw-r--r-- | tools/testing/selftests/bpf/test_verifier.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c index 878bd60da376..247830ecf68e 100644 --- a/tools/testing/selftests/bpf/test_verifier.c +++ b/tools/testing/selftests/bpf/test_verifier.c @@ -24,6 +24,8 @@ #include <linux/bpf_perf_event.h> #include <linux/bpf.h> +#include <bpf/bpf.h> + #include "../../../include/linux/filter.h" #include "bpf_sys.h" @@ -4535,9 +4537,9 @@ static void do_test_single(struct bpf_test *test, bool unpriv, do_test_fixup(test, prog, &fd_f1, &fd_f2, &fd_f3); - fd_prog = bpf_prog_load(prog_type ? : BPF_PROG_TYPE_SOCKET_FILTER, - prog, prog_len * sizeof(struct bpf_insn), - "GPL", bpf_vlog, sizeof(bpf_vlog)); + fd_prog = bpf_load_program(prog_type ? : BPF_PROG_TYPE_SOCKET_FILTER, + prog, prog_len, "GPL", 0, bpf_vlog, + sizeof(bpf_vlog)); expected_ret = unpriv && test->result_unpriv != UNDEF ? test->result_unpriv : test->result; |