summaryrefslogtreecommitdiffstats
path: root/iptables/tests/shell/testcases/nft-only/0007-mid-restore-flush_0
Commit message (Collapse)AuthorAgeFilesLines
* nft: Fix for ruleset flush while restoringPhil Sutter2020-08-141-0/+23
If ruleset is flushed while an instance of iptables-nft-restore is running and has seen a COMMIT line once, it doesn't notice the disappeared table while handling the next COMMIT. This is due to table existence being tracked via 'initialized' boolean which is only reset by nft_table_flush(). To fix this, drop the dedicated 'initialized' boolean and switch users to the recently introduced 'exists' one. As a side-effect, this causes base chain existence being checked for each command calling nft_xt_builtin_init() as the old 'initialized' bit was used to track if that function has been called before or not. Signed-off-by: Phil Sutter <phil@nwl.cc> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>