summaryrefslogtreecommitdiffstats
path: root/iptables/nft-cache.h
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2019-10-07 18:40:40 +0200
committerPhil Sutter <phil@nwl.cc>2019-10-17 19:02:39 +0200
commitc6d3ae9437e96c0076e43907f1867d7e306ca9fe (patch)
tree081de4945a43628b057c1f3da68a3d44a61f1b96 /iptables/nft-cache.h
parentb5cb6e631c828bdcd0715bc1ea94f9e753582b9d (diff)
nft-cache: Cover for multiple fetcher invocation
Preparing for partial caches, it is necessary to make sure these functions don't cause harm if called repeatedly. * Use h->cache->tables pointer as indicator for existing table cache, return immediately from fetch_table_cache() if non-NULL. * Initialize table's chain list only if non-NULL. * Search for chain in table's chain list before adding it. * Don't fetch rules for a chain if it has any rules already. With rule list being embedded in struct nftnl_chain, this is the best way left to check if rules have been fetched already or not. It will fail for empty chains, but causes no harm in that case, either. Signed-off-by: Phil Sutter <phil@nwl.cc> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/nft-cache.h')
0 files changed, 0 insertions, 0 deletions