Commit fc3ffd82 authored by Andrei Vagin's avatar Andrei Vagin

net: handle a case when --empty net is set only for criu dump

The origin idea was to set --empty net for criu dump and criu restore,
but before cde33dcb ("empty-ns: Don't C/R iptables too (v2)"),
criu restore worked without --empty net and we didn't notice that
docker doesn't set this option on restore.

After a small brainstorm, we decided that it is better to remove
this requirement. Docker has to set this option, but with this changes,
the docker issue will be less urgent.

https://github.com/checkpoint-restore/criu/issues/393Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 71e2bdc9
...@@ -2193,6 +2193,9 @@ static int restore_netns_ids(struct ns_id *ns) ...@@ -2193,6 +2193,9 @@ static int restore_netns_ids(struct ns_id *ns)
{ {
int i, sk, exit_code = -1; int i, sk, exit_code = -1;
if (!ns->net.netns)
return 0;
sk = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); sk = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (sk < 0) { if (sk < 0) {
pr_perror("Can't open rtnl sock for net dump"); pr_perror("Can't open rtnl sock for net dump");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment