Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2019-11-06 17:49:33 +0800
committerGary Lin <glin@suse.com>2019-11-06 17:49:37 +0800
commit40c1f13488f8c12d2cc2fc85fe365305a094f6b1 (patch)
tree139ed1eea6a0c266c74df90be4d1a7e4df1bf2b3
parent917424f880a4d85fd985294d96b1c7bdb0525688 (diff)
tools: bpftool: fix format string for p_err() in
query_flow_dissector() (bsc#1155518).
-rw-r--r--patches.suse/tools-bpftool-fix-format-string-for-p_err-in-query_f.patch34
-rw-r--r--series.conf1
2 files changed, 35 insertions, 0 deletions
diff --git a/patches.suse/tools-bpftool-fix-format-string-for-p_err-in-query_f.patch b/patches.suse/tools-bpftool-fix-format-string-for-p_err-in-query_f.patch
new file mode 100644
index 0000000000..cd02e8d833
--- /dev/null
+++ b/patches.suse/tools-bpftool-fix-format-string-for-p_err-in-query_f.patch
@@ -0,0 +1,34 @@
+From: Quentin Monnet <quentin.monnet@netronome.com>
+Date: Thu, 15 Aug 2019 15:32:18 +0100
+Subject: tools: bpftool: fix format string for p_err() in
+ query_flow_dissector()
+Patch-mainline: v5.4-rc1
+Git-commit: 8a15d5ced8c626c0331974c7281c1d651f7b0d83
+References: bsc#1155518
+
+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 <quentin.monnet@netronome.com>
+Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+Acked-by: Gary Lin <glin@suse.com>
+---
+ tools/bpf/bpftool/net.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/tools/bpf/bpftool/net.c
++++ b/tools/bpf/bpftool/net.c
+@@ -197,7 +197,7 @@ static int query_flow_dissector(struct b
+
+ 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;
+ }
diff --git a/series.conf b/series.conf
index ac86ab2fb6..bbc21f9ee7 100644
--- a/series.conf
+++ b/series.conf
@@ -1091,6 +1091,7 @@
patches.suse/tools-bpftool-fix-arguments-for-p_err-in-do_event_pi.patch
patches.suse/tools-bpftool-fix-format-strings-and-arguments-for-j.patch
patches.suse/tools-bpftool-fix-argument-for-p_err-in-BTF-do_dump.patch
+ patches.suse/tools-bpftool-fix-format-string-for-p_err-in-query_f.patch
patches.suse/btf-fix-return-value-check-in-btf_vmlinux_init.patch
patches.suse/xsk-replace-ndo_xsk_async_xmit-with-ndo_xsk_wakeup.patch
patches.suse/xsk-add-support-for-need_wakeup-flag-in-AF_XDP-rings.patch