blob: eb918ebeacb3ebfb6c202b0f8fd148094044ee78 [file] [log] [blame]
From f44cb0d9a4a91f0631152c82df7546bf5345a324 Mon Sep 17 00:00:00 2001
From: Quentin Monnet <>
Date: Thu, 15 Aug 2019 15:32:18 +0100
Subject: [PATCH] tools: bpftool: fix format string for p_err() in
commit 8a15d5ced8c626c0331974c7281c1d651f7b0d83 upstream.
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: 7f0c57fec80f ("bpftool: show flow_dissector attachment status")
Signed-off-by: Quentin Monnet <>
Reviewed-by: Jakub Kicinski <>
Signed-off-by: Alexei Starovoitov <>
Signed-off-by: Paul Gortmaker <>
diff --git a/tools/bpf/bpftool/net.c b/tools/bpf/bpftool/net.c
index 67e99c56bc88..e3b770082a39 100644
--- a/tools/bpf/bpftool/net.c
+++ b/tools/bpf/bpftool/net.c
@@ -197,7 +197,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",
return -1;