diff options
author | Daniel Borkmann <daniel@iogearbox.net> | 2019-08-09 18:38:53 +0300 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-08-09 18:38:53 +0300 |
commit | 4f7aafd78aeaf18a4f6dea9415df60e745c9dfa7 (patch) | |
tree | ff6a09b0cb3b5fbe8a05bd28c6f86fb505a79f7b | |
parent | f1fc7249dddc0e52d9e805e2e661caa118649509 (diff) | |
parent | 3c7be384fe6da0d7b1d6fc0ad6b4a33edb73aad5 (diff) | |
download | linux-4f7aafd78aeaf18a4f6dea9415df60e745c9dfa7.tar.xz |
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>
-rw-r--r-- | tools/bpf/bpftool/common.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/common.c b/tools/bpf/bpftool/common.c index 5215e0870bcb..6a71324be628 100644 --- a/tools/bpf/bpftool/common.c +++ b/tools/bpf/bpftool/common.c @@ -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; } |