bpftool: Fix truncated netlink dumps
authorJakub Kicinski <kuba@kernel.org>
Tue, 17 Feb 2026 19:41:50 +0000 (11:41 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 18 Feb 2026 00:54:03 +0000 (16:54 -0800)
commit3b39d73cc3379360a33eb583b17f21fe55e1288e
tree6d531aee305e0103f1a816aa395f4b265d330c58
parent593fffb8bcfdacc2111a9951afe1fae77988aa4a
bpftool: Fix truncated netlink dumps

Netlink requires that the recv buffer used during dumps is at least
min(PAGE_SIZE, 8k) (see the man page). Otherwise the messages will
get truncated. Make sure bpftool follows this requirement, avoid
missing information on systems with large pages.

Acked-by: Quentin Monnet <qmo@kernel.org>
Fixes: 7084566a236f ("tools/bpftool: Remove libbpf_internal.h usage in bpftool")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Link: https://lore.kernel.org/r/20260217194150.734701-1-kuba@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/net.c
tools/lib/bpf/netlink.c