projects
/
platform
/
kernel
/
linux-rpi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e0975ab
)
libbpf: Always use libbpf_err to return an error in bpf_xdp_query()
author
Lorenzo Bianconi
<lorenzo@kernel.org>
Tue, 7 Feb 2023 11:11:03 +0000
(12:11 +0100)
committer
Daniel Borkmann
<daniel@iogearbox.net>
Tue, 7 Feb 2023 21:56:11 +0000
(22:56 +0100)
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
tools/lib/bpf/netlink.c
patch
|
blob
|
history
diff --git
a/tools/lib/bpf/netlink.c
b/tools/lib/bpf/netlink.c
index 32b13b7a11b0d126cd5609d8fc459b529525aa02..cb082a04ffa8dfbeb8c5608ebe2c4add80cec9d4 100644
(file)
--- 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);