Allow skipping iptables/nftables invocation.

Make it possible to skip network lock to enable uses that break connections
anyway to work without iptables/nftables being present.

Signed-off-by: Michał Mirosław <emmir@google.com>
This commit is contained in:
Michał Mirosław 2022-09-12 16:17:43 +02:00 committed by Andrei Vagin
parent d0ac547b3d
commit c97cc6a6ce
9 changed files with 24 additions and 1 deletions

View file

@ -1868,7 +1868,7 @@ void criu_set_pidfd_store_sk(int sk)
int criu_local_set_network_lock(criu_opts *opts, enum criu_network_lock_method method)
{
opts->rpc->has_network_lock = true;
if (method == CRIU_NETWORK_LOCK_IPTABLES || method == CRIU_NETWORK_LOCK_NFTABLES) {
if (method == CRIU_NETWORK_LOCK_IPTABLES || method == CRIU_NETWORK_LOCK_NFTABLES || method == CRIU_NETWORK_LOCK_SKIP) {
opts->rpc->network_lock = (CriuNetworkLockMethod)method;
return 0;
}

View file

@ -50,6 +50,7 @@ enum criu_cg_mode {
enum criu_network_lock_method {
CRIU_NETWORK_LOCK_IPTABLES = 1,
CRIU_NETWORK_LOCK_NFTABLES = 2,
CRIU_NETWORK_LOCK_SKIP = 3,
};
enum criu_pre_dump_mode { CRIU_PRE_DUMP_SPLICE = 1, CRIU_PRE_DUMP_READ = 2 };