Skip to content

Commit 710e9a7

Browse files
authored
fix: repair sockets when --keep-network-lock enabled (#32)
1 parent ccc0d3f commit 710e9a7

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

criu/cr-dump.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2095,14 +2095,7 @@ static int cr_dump_finish(int ret)
20952095
*/
20962096
if (ret || post_dump_ret || opts.final_state == TASK_ALIVE) {
20972097
unsuspend_lsm();
2098-
/*
2099-
* For live migration we want to be able to recover the process(es) in case
2100-
* the restoration fails. When --keep-network-lock is specified, the network
2101-
* lock is kept until we actually need to recover.
2102-
*/
2103-
if (!opts.keep_network_lock) {
2104-
network_unlock();
2105-
}
2098+
network_unlock();
21062099
delete_link_remaps();
21072100
clean_cr_time_mounts();
21082101
}

criu/net.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3487,6 +3487,11 @@ void network_unlock(void)
34873487
cpt_unlock_tcp_connections();
34883488
rst_unlock_tcp_connections();
34893489

3490+
if (opts.keep_network_lock) {
3491+
pr_info("Keeping network lock\n");
3492+
return;
3493+
}
3494+
34903495
if (root_ns_mask & CLONE_NEWNET) {
34913496
/* coverity[check_return] */
34923497
run_scripts(ACT_NET_UNLOCK);

0 commit comments

Comments
 (0)