summaryrefslogtreecommitdiffstats
path: root/iptables/tests/shell/testcases/nft-only/0007-mid-restore-flush_0
Commit message (Collapse)AuthorAgeFilesLines
* tests: shell: Fix for ineffective 0007-mid-restore-flush_0Phil Sutter2023-09-141-5/+5
| | | | | | | | | | | | | The test did not catch non-zero exit status of the spawned coprocess. To make it happen, Drop the line killing it (it will exit anyway) and pass its PID to 'wait'. While being at it, put the sleep into the correct spot (otherwise the check for chain 'foo' existence fails as it runs too early) and make said chain existence check effective. Fixes: 4e3c11a6f5a94 ("nft: Fix for ruleset flush while restoring") Signed-off-by: Phil Sutter <phil@nwl.cc>
* 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>