iproute2/lib
Andrea Claudi 2f5825cb38 lib: bpf_legacy: fix bpffs mount when /sys/fs/bpf exists
bpf selftests using iproute2 fails with:

$ ip link set dev veth0 xdp object ../bpf/xdp_dummy.o section xdp_dummy
Continuing without mounted eBPF fs. Too old kernel?
mkdir (null)/globals failed: No such file or directory
Unable to load program

This happens when the /sys/fs/bpf directory exists. In this case, mkdir
in bpf_mnt_check_target() fails with errno == EEXIST, and the function
returns -1. Thus bpf_get_work_dir() does not call bpf_mnt_fs() and the
bpffs is not mounted.

Fix this in bpf_mnt_check_target(), returning 0 when the mountpoint
exists.

Fixes: d4fcdbbec9 ("lib/bpf: Fix and simplify bpf_mnt_check_target()")
Reported-by: Mingyu Shi <mshi@redhat.com>
Reported-by: Jiri Benc <jbenc@redhat.com>
Suggested-by: Jiri Benc <jbenc@redhat.com>
Signed-off-by: Andrea Claudi <aclaudi@redhat.com>
Reviewed-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
2021-09-22 17:30:52 -07:00
..
Makefile build: Fix link errors on some systems 2021-01-18 12:28:47 -08:00
bpf_glue.c lib: bpf_glue: remove useless assignment 2021-08-10 20:01:54 -07:00
bpf_legacy.c lib: bpf_legacy: fix bpffs mount when /sys/fs/bpf exists 2021-09-22 17:30:52 -07:00
bpf_libbpf.c libbpf: fix attach of prog with multiple sections 2021-07-06 16:59:39 -07:00
cg_map.c lib: ignore invalid mounts in cg_init_map 2020-10-11 23:02:35 -07:00
color.c lib/color: make local functions static 2018-11-19 11:42:44 -08:00
coverity_model.c scrub out whitespace issues 2016-03-27 10:50:14 -07:00
exec.c netns: switch netns in the child when executing commands 2019-06-20 14:30:41 -07:00
fs.c Merge branch 'main' into next 2021-07-01 14:29:42 +00:00
inet_proto.c ip: add a new parameter -Numeric 2019-06-18 08:37:47 -07:00
json_print.c json_print: Add print_tv() 2021-03-19 15:00:08 +00:00
json_print_math.c build: Fix link errors on some systems 2021-01-18 12:28:47 -08:00
json_writer.c json: fix backslash escape typo in jsonw_puts 2019-07-19 10:48:38 -07:00
libgenl.c libgenl: make genl_add_mcast_grp set errno on error 2021-05-17 11:59:37 -07:00
libnetlink.c ipmonitor: Fix recvmsg with ancillary data 2021-07-17 11:13:36 -07:00
ll_addr.c lib/ll_addr: whitespace and indent cleanup 2018-11-19 11:42:44 -08:00
ll_map.c ip: allow to use alternative names as handle 2019-10-28 07:35:29 -07:00
ll_proto.c m_mpls: add mac_push action 2020-10-20 08:57:08 -06:00
ll_types.c ip: add a new parameter -Numeric 2019-06-18 08:37:47 -07:00
mnl_utils.c utils: Introduce helper routines for generic socket recv 2021-03-03 04:00:04 +00:00
mpls_ntop.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
mpls_pton.c SPDX license identifiers 2017-11-24 12:21:35 -08:00
names.c tc: drop unused name_to_id function 2018-11-19 11:42:44 -08:00
namespace.c lib/namespace: fix ip -all netns return code 2021-02-22 18:17:56 -08:00
rt_names.c lib: rt_names: Add rtnl_dsfield_get_name() 2021-01-18 04:09:29 +00:00
utils.c ip: remove leftovers from IPX and DECnet 2021-09-01 14:03:53 -07:00
utils_math.c build: Fix link errors on some systems 2021-01-18 12:28:47 -08:00