vrf: print BPF log buffer if bpf_program_load fails

Necessary to understand what is going on when bpf_program_load fails

Signed-off-by: Luca Boccassi <bluca@debian.org>
Reviewed-by: David Ahern <dsahern@kernel.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Luca Boccassi 2021-01-17 22:54:26 +00:00 committed by Stephen Hemminger
parent 1a22ad2721
commit 8dca565b17
1 changed files with 2 additions and 2 deletions

View File

@ -278,8 +278,8 @@ static int vrf_configure_cgroup(const char *path, int ifindex)
*/
prog_fd = prog_load(ifindex);
if (prog_fd < 0) {
fprintf(stderr, "Failed to load BPF prog: '%s'\n",
strerror(errno));
fprintf(stderr, "Failed to load BPF prog: '%s'\n%s",
strerror(errno), bpf_log_buf);
if (errno != EPERM) {
fprintf(stderr,