diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2025-03-17 13:50:56 -0700 |
---|---|---|
committer | Andrii Nakryiko <andrii@kernel.org> | 2025-03-17 13:50:57 -0700 |
commit | f3f8649585a445414521a6d5b76f41b51205086d (patch) | |
tree | 33f45a2bcc436b5864e1676b3c2816b406bdfc7d /tools/bpf/bpftool/net.c | |
parent | b02f072a36560a89155a1ebcb2ca6bd881333a8b (diff) | |
parent | 3775be3417cc3243b0df0492bd308559dcf0560b (diff) |
Merge branch 'bpftool-using-the-right-format-specifiers'
Jiayuan Chen says:
====================
bpftool: Using the right format specifiers
This patch adds the -Wformat-signedness compiler flag to detect and
prevent format string errors, where signed or unsigned types are
mismatched with format specifiers. Additionally, it fixes some format
string errors that were not fully addressed by the previous patch [1].
[1] https://lore.kernel.org/bpf/20250207123706.727928-1-mrpre@163.com/T/#u
---
v1->v2:
https://lore.kernel.org/bpf/20250310142037.45932-1-jiayuan.chen@linux.dev/
---
====================
Link: https://patch.msgid.link/20250311112809.81901-1-jiayuan.chen@linux.dev
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Diffstat (limited to 'tools/bpf/bpftool/net.c')
-rw-r--r-- | tools/bpf/bpftool/net.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/bpf/bpftool/net.c b/tools/bpf/bpftool/net.c index d2242d9f8441..64f958f437b0 100644 --- a/tools/bpf/bpftool/net.c +++ b/tools/bpf/bpftool/net.c @@ -476,7 +476,7 @@ static void __show_dev_tc_bpf(const struct ip_devname_ifindex *dev, for (i = 0; i < optq.count; i++) { NET_START_OBJECT; NET_DUMP_STR("devname", "%s", dev->devname); - NET_DUMP_UINT("ifindex", "(%u)", dev->ifindex); + NET_DUMP_UINT("ifindex", "(%u)", (unsigned int)dev->ifindex); NET_DUMP_STR("kind", " %s", attach_loc_strings[loc]); ret = __show_dev_tc_bpf_name(prog_ids[i], prog_name, sizeof(prog_name)); @@ -831,7 +831,7 @@ static void show_link_netfilter(void) if (err) { if (errno == ENOENT) break; - p_err("can't get next link: %s (id %d)", strerror(errno), id); + p_err("can't get next link: %s (id %u)", strerror(errno), id); break; } |