]> git.ipfire.org Git - thirdparty/iptables.git/commit
nft: Implement nft_chain_foreach()
authorPhil Sutter <phil@nwl.cc>
Wed, 8 Jul 2020 14:09:52 +0000 (16:09 +0200)
committerPhil Sutter <phil@nwl.cc>
Mon, 21 Dec 2020 17:33:21 +0000 (18:33 +0100)
commit09af1117340cfd1885eb2f0a7b522f2d85f66185
treeee70d2ccf353dda4fcfe27e8c14dddee41272c0a
parente8d48d7b41ec09eb67f69a2bed04628870ec85c3
nft: Implement nft_chain_foreach()

This is just a fancy wrapper around nftnl_chain_list_foreach() with the
added benefit of detecting invalid table names or uninitialized chain
lists. This in turn allows to drop the checks in flush_rule_cache() and
ignore the return code of nft_chain_foreach() as it fails only if the
dropped checks had failed, too.

Since this wrapper does the chain list lookup by itself, use of
nft_chain_list_get() shrinks down to a single place, namely inside
nft_chain_find(). Therefore fold it into the latter.

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