New features
- Add support for attaching and detaching tcx programs with
bpftool net
, along with relevant documentation and bash completion. (388bca8, 07c984a, 00e7019) - When dumping BTF information, support dumping kfunc prototypes. Users willing to use kfunc no longer have to define the prototypes themselves, then can use the generated header file. This is also convenient to check what kfuncs are available in the running kernel. (3e0251a, 7cbe3da)
- Sort the output from the dump, in C format, of BTF objects. Sorting the output helps applying diff tools on the generated header files, and helps generate a more natural ordering in the header. (0c50be2, 6ffd3af, f333f55)
- Print richer information when dumping
sockmap
links. (bfdb1e5) - In BPF skeletons, auto-attach
struct_ops
BPF maps as part of<skeleton>__attach()
, defineBPF_SKEL_SUPPORTS_MAP_AUTO_ATTACH
accordingly. (5f63dbb, aa95345) - Improvements in libbpf bring the ability to open and work with object files in either endianness for some operations like object linking or light BPF skeleton creation. (libbpf/libbpf@5ae8432d15e7, libbpf/libbpf@628b21dbcd61, libbpf/libbpf@6ac8762ecd1c, libbpf/libbpf@8244006267a5)
Bug fixes
- Bpftool automatically mounts the BPF virtual file system (bpffs) when necessary, for example to pin programs. This bpffs was mounted on the parent directory for the provided path under certain circumstances. Now bpftool mounts the bpffs on the provided path instead, as expected. (54bcb7c)
- When loading programs and trying to pin the maps, attempt to mount the bpffs when the provided path for the maps is not under an existing bpffs already, as bpftool usually does for other similar commands. (6bcdeb8)
- Use
__typeof__()
rather thantypeof()
in BPF skeleton, to improve compatibility with C++. (9fd551e) - Fix cgroup-related queries to avoid trying to dump (inaccessible) Netkit-related information. (1a70a53)
- Fix backward compatibility issue related to
struct_ops
maps handling for BPF skeletons used with older versions of libbpf. (1b935a7) - Fix various build issues, some of them only affecting the GitHub mirror repository:
- Unset
DESTDIR
before passing it to libbpf, to avoid header files to be installed at an unexpected location. (06c61ec) - Fix clang warnings produced by unnecessary library flags in
CFLAGS
. (119fc2c) - Fix make dependencies for vmlinux.h. (5cd336c)
- Fix silent mode detection (
-s
) for descending into bpftool's documentation Makefile in the GitHub mirror repository. With make 4.4+, the test would pass anytime we pass a string containing the letters
to make. (b3d4318) - Define PACKAGE at build time when trying to detect libbfd, in the GitHub mirror repository, to accommodate with some systems expecting the macro to be defined for using bfd.h or dis-asm.h. (bf9e060)
- Always disable unused CLI arguments warning for feature probe in the GitHub mirror repository, to avoid such warnings to make the probe fail. (3be8ac3)
- Unset
- Many trivial improvements to bpftool's documentation and bash completion, such as formatting fixes, typo fixes, or minor clarifications. (0451298, 214eb3e, 4ce420d, e540cc6, 4d5ad13, 05f5422, f09e341, 3f68270)
- Fix typos in error message and usage help message. (0cad6b8, a44a93b)
Other internal changes
- Update internal BPF program to adjust support for BPF links that support
epoll
, when collecting information for process holding information on a link. (820fac6) - Use BTF field iterator when generating minimized BTF. (9204347)
- Add a
.mailmap
file to the GitHub repository. This file is used to map author's names and addresses from Git history to their preferred form (for example, it replaces the previous email address of a given author with their current address when displaying Git logs). It is kept in sync with the one from the kernel for all contributors to bpftool (starting from the creation of the mirror repository). (744e0cd) - Fix an incorrect format specifier used when dumping non-JITed program instructions. (cb035aa)
- Fix undefined behavior caused by shifting into the sign bit, when internally listing program flags to show tc programs attached to each interface. (a0f887b)
- Fix undefined behavior in
qsort(NULL, 0, ...)
when there is no netfilter program to list, reported by UBSan. (37e304d)
Known bugs
- Static builds on Ubuntu 24.04 may fail because of a missing linker flag to add the zstd library. (#152)
Full Changelog: v7.4.0...v7.5.0