Merge branch 'bpf-bpftool-pinning-error-msg'

Jakub Kicinski says:

====================
First make sure we don't use "prog" in error messages because
the pinning operation could be performed on a map. Second add
back missing error message if pin syscall failed.
====================

Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
Daniel Borkmann 2019-08-09 17:38:53 +02:00
commit 4f7aafd78a

View File

@ -204,7 +204,11 @@ int do_pin_fd(int fd, const char *name)
if (err)
return err;
return bpf_obj_pin(fd, name);
err = bpf_obj_pin(fd, name);
if (err)
p_err("can't pin the object (%s): %s", name, strerror(errno));
return err;
}
int do_pin_any(int argc, char **argv, int (*get_fd_by_id)(__u32))
@ -237,7 +241,7 @@ int do_pin_any(int argc, char **argv, int (*get_fd_by_id)(__u32))
fd = get_fd_by_id(id);
if (fd < 0) {
p_err("can't get prog by id (%u): %s", id, strerror(errno));
p_err("can't open object by id (%u): %s", id, strerror(errno));
return -1;
}