]> git.ipfire.org Git - thirdparty/iptables.git/commit
xtables: Optimize nft_chain_zero_counters()
authorPhil Sutter <phil@nwl.cc>
Thu, 20 Dec 2018 15:09:15 +0000 (16:09 +0100)
committerPablo Neira Ayuso <pablo@netfilter.org>
Thu, 27 Dec 2018 19:42:10 +0000 (20:42 +0100)
commita6ce0c65d3a390bfff16e834c18650beedecf40c
tree798dec1955c82cb16030626bb87f297bcae5fc43
parent196841c9597eff536b59655b60df088ee1929904
xtables: Optimize nft_chain_zero_counters()

If a chain name was given, make use of nftnl_chain_list_lookup_byname().
Streamline nft_chain_zero_rule_counters() to be suitable for calling
from nftnl_chain_list_foreach().

There is an unrelated optimization in here, too: Add batch job
NFT_COMPAT_CHAIN_ZERO only if it is a base chain. Since user-defined
chains don't have counters, there is no need to do anything for them.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
iptables/nft.c