[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1483662143-15242-4-git-send-email-dsa@cumulusnetworks.com>
Date: Thu, 5 Jan 2017 16:22:23 -0800
From: David Ahern <dsa@...ulusnetworks.com>
To: netdev@...r.kernel.org, stephen@...workplumber.org
Cc: David Ahern <dsa@...ulusnetworks.com>
Subject: [PATCH iproute2 3/3] 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@...ulusnetworks.com>
---
ip/ipvrf.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ip/ipvrf.c b/ip/ipvrf.c
index dc8364a43a57..8bd99d6251f2 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;
}
--
2.1.4
Powered by blists - more mailing lists