selftests/bpf: Switch fexit_bpf2bpf selftest to set_attach_target() API

Switch fexit_bpf2bpf selftest to bpf_program__set_attach_target()
instead of using bpf_object_open_opts.attach_prog_fd, which is going to
be deprecated. These changes also demonstrate the new mode of
set_attach_target() in which it allows NULL when the target is BPF
program (attach_prog_fd != 0).

Signed-off-by: Andrii Nakryiko <>
Signed-off-by: Alexei Starovoitov <>
Acked-by: Yonghong Song <>
1 file changed