From: David Ahern Date: Fri, 6 Jan 2017 00:22:23 +0000 (-0800) Subject: ip vrf: Improve bpf error messages X-Git-Tag: v4.10.0~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b036afd3cb067d722817765a120a8221096b196;p=thirdparty%2Fiproute2.git 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 --- diff --git a/ip/ipvrf.c b/ip/ipvrf.c index dc8364a43..8bd99d625 100644 --- a/ip/ipvrf.c +++ b/ip/ipvrf.c @@ -181,7 +181,11 @@ static int vrf_configure_cgroup(const char *path, int ifindex) if (prog_fd < 0) { fprintf(stderr, "Failed to load BPF prog: '%s'\n", 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; }