summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2023-02-07 14:11:03 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2023-02-08 00:56:11 +0300
commit02fc0e73e852f78ec374004f924b9d84275d0006 (patch)
tree7884aab387387058beb51841b45b03ae8955d8b1 /tools
parente0975ab92f2406fd3e12834f62dc57cb10404f85 (diff)
downloadlinux-02fc0e73e852f78ec374004f924b9d84275d0006.tar.xz
libbpf: Always use libbpf_err to return an error in bpf_xdp_query()
In order to properly set errno, rely on libbpf_err utility routine in bpf_xdp_query() to return an error to the caller. Fixes: 04d58f1b26a4 ("libbpf: add API to get XDP/XSK supported features") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/827d40181f9f90fb37702f44328e1614df7c0503.1675768112.git.lorenzo@kernel.org
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/bpf/netlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/lib/bpf/netlink.c b/tools/lib/bpf/netlink.c
index 32b13b7a11b0..cb082a04ffa8 100644
--- a/tools/lib/bpf/netlink.c
+++ b/tools/lib/bpf/netlink.c
@@ -480,7 +480,7 @@ int bpf_xdp_query(int ifindex, int xdp_flags, struct bpf_xdp_query_opts *opts)
err = nlattr_add(&req, NETDEV_A_DEV_IFINDEX, &ifindex, sizeof(ifindex));
if (err < 0)
- return err;
+ return libbpf_err(err);
err = libbpf_netlink_send_recv(&req, NETLINK_GENERIC,
parse_xdp_features, NULL, &md);