mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-29 04:50:26 +00:00
cd-dump: lock connection with iptables rules only in a current netns
For another netns we don't need to lock separate connections, an external chanel can be locked. Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
8e90ed8c4d
commit
fbea445df4
1 changed files with 7 additions and 4 deletions
11
sk-tcp.c
11
sk-tcp.c
|
|
@ -67,9 +67,11 @@ static int tcp_repair_establised(int fd, struct inet_sk_desc *sk)
|
|||
goto err1;
|
||||
}
|
||||
|
||||
ret = nf_lock_connection(sk);
|
||||
if (ret < 0)
|
||||
goto err2;
|
||||
if (!(opts.namespaces_flags & CLONE_NEWNET)) {
|
||||
ret = nf_lock_connection(sk);
|
||||
if (ret < 0)
|
||||
goto err2;
|
||||
}
|
||||
|
||||
ret = tcp_repair_on(sk->rfd);
|
||||
if (ret < 0)
|
||||
|
|
@ -79,7 +81,8 @@ static int tcp_repair_establised(int fd, struct inet_sk_desc *sk)
|
|||
return 0;
|
||||
|
||||
err3:
|
||||
nf_unlock_connection(sk);
|
||||
if (!(opts.namespaces_flags & CLONE_NEWNET))
|
||||
nf_unlock_connection(sk);
|
||||
err2:
|
||||
close(sk->rfd);
|
||||
err1:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue