Skip to content

Commit

Permalink
tools: bpftool: fix format string for p_err() in query_flow_dissector()
Browse files Browse the repository at this point in the history
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: 7f0c57f ("bpftool: show flow_dissector attachment status")
Signed-off-by: Quentin Monnet <quentin.monnet@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Quentin Monnet authored and Alexei Starovoitov committed Aug 16, 2019
1 parent ed4a398 commit 8a15d5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/bpf/bpftool/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static int query_flow_dissector(struct bpf_attach_info *attach_info)

fd = open("/proc/self/ns/net", O_RDONLY);
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));
return -1;
}
Expand Down

0 comments on commit 8a15d5c

Please sign in to comment.