提交 8a15d5ce 编写于 作者: Q Quentin Monnet 提交者: Alexei Starovoitov

tools: bpftool: fix format string for p_err() in query_flow_dissector()

The format string passed to one call to the p_err() function in
query_flow_dissector() does not match the value that should be printed,
resulting in some garbage integer being printed instead of
strerror(errno) if /proc/self/ns/net cannot be open. Let's fix the
format string.

Fixes: 7f0c57fe ("bpftool: show flow_dissector attachment status")
Signed-off-by: NQuentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: NAlexei Starovoitov <ast@kernel.org>
上级 ed4a3983
...@@ -226,7 +226,7 @@ static int query_flow_dissector(struct bpf_attach_info *attach_info) ...@@ -226,7 +226,7 @@ static int query_flow_dissector(struct bpf_attach_info *attach_info)
fd = open("/proc/self/ns/net", O_RDONLY); fd = open("/proc/self/ns/net", O_RDONLY);
if (fd < 0) { if (fd < 0) {
p_err("can't open /proc/self/ns/net: %d", p_err("can't open /proc/self/ns/net: %s",
strerror(errno)); strerror(errno));
return -1; return -1;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册