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:
parent
bf8446ae5f
commit
eecc53d05a
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user