Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
criu
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhul
criu
Commits
c2b78007
Commit
c2b78007
authored
Aug 23, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check: Add tun support
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
ed5f82c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
0 deletions
+26
-0
cr-check.c
cr-check.c
+2
-0
tun.h
include/tun.h
+1
-0
tun.c
tun.c
+23
-0
No files found.
cr-check.c
View file @
c2b78007
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include "tty.h"
#include "tty.h"
#include "ptrace.h"
#include "ptrace.h"
#include "kerndat.h"
#include "kerndat.h"
#include "tun.h"
static
int
check_tty
(
void
)
static
int
check_tty
(
void
)
{
{
...
@@ -559,6 +560,7 @@ int cr_check(void)
...
@@ -559,6 +560,7 @@ int cr_check(void)
ret
|=
check_ptrace_peeksiginfo
();
ret
|=
check_ptrace_peeksiginfo
();
ret
|=
check_mem_dirty_track
();
ret
|=
check_mem_dirty_track
();
ret
|=
check_posix_timers
();
ret
|=
check_posix_timers
();
ret
|=
check_tun
();
if
(
!
ret
)
if
(
!
ret
)
pr_msg
(
"Looks good.
\n
"
);
pr_msg
(
"Looks good.
\n
"
);
...
...
include/tun.h
View file @
c2b78007
...
@@ -10,4 +10,5 @@ extern const struct fdtype_ops tunfile_dump_ops;
...
@@ -10,4 +10,5 @@ extern const struct fdtype_ops tunfile_dump_ops;
int
dump_tun_link
(
NetDeviceEntry
*
nde
,
struct
cr_fdset
*
fds
);
int
dump_tun_link
(
NetDeviceEntry
*
nde
,
struct
cr_fdset
*
fds
);
int
restore_one_tun
(
NetDeviceEntry
*
nde
,
int
nlsk
);
int
restore_one_tun
(
NetDeviceEntry
*
nde
,
int
nlsk
);
extern
struct
collect_image_info
tunfile_cinfo
;
extern
struct
collect_image_info
tunfile_cinfo
;
int
check_tun
(
void
);
#endif
#endif
tun.c
View file @
c2b78007
...
@@ -44,6 +44,29 @@
...
@@ -44,6 +44,29 @@
#define TUN_DEV_GEN_PATH "/dev/net/tun"
#define TUN_DEV_GEN_PATH "/dev/net/tun"
int
check_tun
(
void
)
{
int
fd
,
idx
=
13
,
ret
;
if
(
opts
.
check_ms_kernel
)
{
pr_warn
(
"Skipping tun support check
\n
"
);
return
0
;
}
fd
=
open
(
TUN_DEV_GEN_PATH
,
O_RDWR
);
if
(
fd
<
0
)
{
pr_perror
(
"Can't check tun support"
);
return
0
;
}
ret
=
ioctl
(
fd
,
TUNSETIFINDEX
,
&
idx
);
if
(
ret
<
0
)
pr_perror
(
"No proper support for tun dump/restore"
);
close
(
fd
);
return
ret
;
}
static
LIST_HEAD
(
tun_links
);
static
LIST_HEAD
(
tun_links
);
struct
tun_link
{
struct
tun_link
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment