summaryrefslogtreecommitdiffstats
path: root/iptables/xtables-restore.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-04-23 15:16:22 +0200
committerFlorian Westphal <fw@strlen.de>2019-04-27 01:08:46 +0200
commit862818ac3a0de5642444dfc9aa06e0f6fbb3ef38 (patch)
treeed68082823e7705bbb7a854ab781e080bb003ed2 /iptables/xtables-restore.c
parentd3e378b4a93f485d5ba5ba395dba9befaa5d133b (diff)
xtables: add and use nft_build_cache
Will be used with the "generation id" infrastructure. When we're told that the commit failed because someone else made changes, we can use this to re-initialize the cache and then revalidate the transaction list (e.g. to detect that we now have to flush the user-defined chain 'foo' that we wanted to create, but was added just now by someone else). Signed-off-by: Florian Westphal <fw@strlen.de> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'iptables/xtables-restore.c')
-rw-r--r--iptables/xtables-restore.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/iptables/xtables-restore.c b/iptables/xtables-restore.c
index b12ab6a6..a6a331d3 100644
--- a/iptables/xtables-restore.c
+++ b/iptables/xtables-restore.c
@@ -145,10 +145,7 @@ void xtables_restore_parse(struct nft_handle *h,
if (p->tablename && (strcmp(p->tablename, table) != 0))
continue;
- /* Fixme: Needed to init chain cache.
- * Should create explicit function to do this.
- */
- nft_chain_list_get(h, table);
+ nft_build_cache(h);
if (h->noflush == 0) {
DEBUGP("Cleaning all chains of table '%s'\n",