]> git.ipfire.org Git - thirdparty/iptables.git/commit
nft: Reduce overhead in nft_rule_find()
authorPhil Sutter <phil@nwl.cc>
Wed, 31 Jul 2024 00:16:05 +0000 (02:16 +0200)
committerPhil Sutter <phil@nwl.cc>
Wed, 14 Aug 2024 07:50:31 +0000 (09:50 +0200)
commit1778e51e5bf670b96a139248f7a0df84ef5b61c2
tree8e7e8d344b5dbe923c874ce50c7e2477ac2e784d
parent5bef3c1293092e4849a5d06032b3fa3ec10aba99
nft: Reduce overhead in nft_rule_find()

When iterating through the list of rules in a chain comparing against a
sample, there is no point in carrying that sample as nftnl_rule object
and converting into iptables_command_state object prior to each
comparison. Just do it up front and adjust the callback accordingly.

Signed-off-by: Phil Sutter <phil@nwl.cc>
iptables/nft.c