]> git.ipfire.org Git - thirdparty/nftables.git/commit
cache: Optimize caching for 'list tables' command
authorPhil Sutter <phil@nwl.cc>
Tue, 6 Feb 2024 18:26:57 +0000 (19:26 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Wed, 22 Jan 2025 23:41:54 +0000 (00:41 +0100)
commit6c5deaa4d14382352e42ecb89048e47e4070eb6a
tree88d0db0fdac9ca5dc3eed79bc18d77240fd10cc7
parentf0e6d34ff8c4412e045646b119fbc538e90a74e2
cache: Optimize caching for 'list tables' command

commit 674eb7fa2895813b25f6fbfcc9417fc0788fade1 upstream.

No point in fetching anything other than existing tables from kernel:
'list tables' merely prints existing table names, no contents.

Also populate filter's family field to reduce overhead when listing
tables in one family with many tables in another one. It works without
further adjustments because nftnl_nlmsg_build_hdr() will use the value
for nfgen_family.

Reported-by: anton.khazan@gmail.com
Link: https://bugzilla.netfilter.org/show_bug.cgi?id=1735
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/cache.c