2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

tun: Don't dump tun file if we're not taking netns with us

Tun files are attached to tun links, thus we need the latter to
be dumped together with the former.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Pavel Emelyanov
2013-08-28 19:39:56 +04:00
parent 369f366a36
commit 1943d08c38

6
tun.c
View File

@@ -12,6 +12,7 @@
#include "files-reg.h"
#include "tun.h"
#include "net.h"
#include "namespaces.h"
#include "protobuf/tun.pb-c.h"
@@ -268,6 +269,11 @@ static int dump_tunfile(int lfd, u32 id, const struct fd_parms *p)
TunfileEntry tfe = TUNFILE_ENTRY__INIT;
struct ifreq ifr;
if (!(current_ns_mask & CLONE_NEWNET)) {
pr_err("Net namespace is required to dump tun link\n");
return -1;
}
if (dump_one_reg_file(lfd, id, p))
return -1;