From: Andrii Nakryiko <andrii@kernel.org>
Date: Wed, 19 Jan 2022 22:14:20 -0800
Subject: bpftool: use new API for attaching XDP program
Patch-mainline: v5.18-rc1
Git-commit: c86575eccab24d583db0169ded342eb215b781c9
References: jsc#PED-1377
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>
Acked-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
tools/bpf/bpftool/net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/tools/bpf/bpftool/net.c
+++ b/tools/bpf/bpftool/net.c
@@ -551,7 +551,7 @@ static int do_attach_detach_xdp(int prog
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)