Skip to content

Commit

Permalink
selftests/bpf: Use libbpf_attach_type_by_name in test_socket_cookie
Browse files Browse the repository at this point in the history
Use newly introduced libbpf_attach_type_by_name in test_socket_cookie
selftest.

Signed-off-by: Andrey Ignatov <rdna@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
  • Loading branch information
Andrey Ignatov authored and Daniel Borkmann committed Sep 27, 2018
1 parent c6f6851 commit c9bf507
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions tools/testing/selftests/bpf/test_socket_cookie.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,7 @@ static int run_test(int cgfd)
bpf_object__for_each_program(prog, pobj) {
prog_name = bpf_program__title(prog, /*needs_copy*/ false);

if (strcmp(prog_name, "cgroup/connect6") == 0) {
attach_type = BPF_CGROUP_INET6_CONNECT;
} else if (strcmp(prog_name, "sockops") == 0) {
attach_type = BPF_CGROUP_SOCK_OPS;
} else {
if (libbpf_attach_type_by_name(prog_name, &attach_type)) {
log_err("Unexpected prog: %s", prog_name);
goto err;
}
Expand Down

0 comments on commit c9bf507

Please sign in to comment.