Commit 4f7aafd7 authored by Daniel Borkmann's avatar Daniel Borkmann

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: default avatarYonghong Song <yhs@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parents f1fc7249 3c7be384
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment