2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 05:48:05 +00:00

kerndat: Don't fail on NETLINK/nsid support missing.

If not dumping netns nor connections, nsid support is not used. Don't
fail the run as if the support is needed, the dumping process will fail
later.

Change-Id: I39a086756f6d520c73bb6b21eaf6d9fb49a18879
Signed-off-by: Michał Mirosław <emmir@google.com>
This commit is contained in:
Michał Mirosław 2023-06-22 21:33:16 +02:00 committed by Andrei Vagin
parent bf8446ae5f
commit eecc53d05a

View File

@ -707,16 +707,18 @@ static int kerndat_nsid(void)
{
int nsid, sk;
kdat.has_nsid = false;
sk = socket(PF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
if (sk < 0) {
pr_perror("Unable to create a netlink socket");
return -1;
pr_pwarn("Unable to create a netlink socket: NSID can't be used.");
return 0;
}
if (net_get_nsid(sk, getpid(), &nsid) < 0) {
pr_err("NSID is not supported\n");
pr_warn("NSID is not supported\n");
close(sk);
return -1;
return 0;
}
kdat.has_nsid = true;