Skip to content

Commit

Permalink
bpftool: use new API for attaching XDP program
Browse files Browse the repository at this point in the history
Switch to new bpf_xdp_attach() API to avoid deprecation warnings.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20220120061422.2710637-3-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Andrii Nakryiko authored and Alexei Starovoitov committed Jan 21, 2022
1 parent c359821 commit c86575e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/bpf/bpftool/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ static int do_attach_detach_xdp(int progfd, enum net_attach_type attach_type,
if (attach_type == NET_ATTACH_TYPE_XDP_OFFLOAD)
flags |= XDP_FLAGS_HW_MODE;

return bpf_set_link_xdp_fd(ifindex, progfd, flags);
return bpf_xdp_attach(ifindex, progfd, flags, NULL);
}

static int do_attach(int argc, char **argv)
Expand Down

0 comments on commit c86575e

Please sign in to comment.