ip vrf: Improve bpf error messages
Next up a non-root user gets various bpf related error messages: $ ip vrf exec mgmt bash Failed to load BPF prog: 'Operation not permitted' Kernel compiled with CGROUP_BPF enabled? Catch the EPERM error and do not show the kernel config option. Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
This commit is contained in:
parent
2bbc5b0726
commit
9b036afd3c
|
|
@ -181,7 +181,11 @@ static int vrf_configure_cgroup(const char *path, int ifindex)
|
||||||
if (prog_fd < 0) {
|
if (prog_fd < 0) {
|
||||||
fprintf(stderr, "Failed to load BPF prog: '%s'\n",
|
fprintf(stderr, "Failed to load BPF prog: '%s'\n",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
fprintf(stderr, "Kernel compiled with CGROUP_BPF enabled?\n");
|
|
||||||
|
if (errno != EPERM) {
|
||||||
|
fprintf(stderr,
|
||||||
|
"Kernel compiled with CGROUP_BPF enabled?\n");
|
||||||
|
}
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue