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
4ec76b28
Commit
4ec76b28
authored
May 03, 2012
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tcp: Add code for "check"-ing TCP repair support
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
1dc8527d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
1 deletion
+22
-1
cr-check.c
cr-check.c
+3
-0
sk-inet.h
include/sk-inet.h
+2
-0
sk-tcp.c
sk-tcp.c
+17
-1
No files found.
cr-check.c
View file @
4ec76b28
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
#include "log.h"
#include "log.h"
#include "util-net.h"
#include "util-net.h"
#include "syscall.h"
#include "syscall.h"
#include "files.h"
#include "sk-inet.h"
static
int
check_map_files
(
void
)
static
int
check_map_files
(
void
)
{
{
...
@@ -150,6 +152,7 @@ int cr_check(void)
...
@@ -150,6 +152,7 @@ int cr_check(void)
ret
|=
check_prctl
();
ret
|=
check_prctl
();
ret
|=
check_fcntl
();
ret
|=
check_fcntl
();
ret
|=
check_proc_stat
();
ret
|=
check_proc_stat
();
ret
|=
check_tcp_repair
();
if
(
!
ret
)
if
(
!
ret
)
pr_msg
(
"Looks good.
\n
"
);
pr_msg
(
"Looks good.
\n
"
);
...
...
include/sk-inet.h
View file @
4ec76b28
...
@@ -39,4 +39,6 @@ int restore_one_tcp(int sk, struct inet_sk_info *si);
...
@@ -39,4 +39,6 @@ int restore_one_tcp(int sk, struct inet_sk_info *si);
struct
cr_options
;
struct
cr_options
;
void
show_tcp_stream
(
int
fd
,
struct
cr_options
*
);
void
show_tcp_stream
(
int
fd
,
struct
cr_options
*
);
int
check_tcp_repair
(
void
);
#endif
#endif
sk-tcp.c
View file @
4ec76b28
...
@@ -46,7 +46,7 @@ static int tcp_repair_on(int fd)
...
@@ -46,7 +46,7 @@ static int tcp_repair_on(int fd)
ret
=
setsockopt
(
fd
,
SOL_TCP
,
TCP_REPAIR
,
&
aux
,
sizeof
(
aux
));
ret
=
setsockopt
(
fd
,
SOL_TCP
,
TCP_REPAIR
,
&
aux
,
sizeof
(
aux
));
if
(
ret
<
0
)
if
(
ret
<
0
)
pr_perror
(
"Can't turn
repair
ON"
);
pr_perror
(
"Can't turn
TCP repair mode
ON"
);
return
ret
;
return
ret
;
}
}
...
@@ -537,3 +537,19 @@ void show_tcp_stream(int fd, struct cr_options *opt)
...
@@ -537,3 +537,19 @@ void show_tcp_stream(int fd, struct cr_options *opt)
pr_img_tail
(
CR_FD_TCP_STREAM
);
pr_img_tail
(
CR_FD_TCP_STREAM
);
}
}
int
check_tcp_repair
(
void
)
{
int
sk
,
ret
;
sk
=
socket
(
PF_INET
,
SOCK_STREAM
,
IPPROTO_TCP
);
if
(
sk
<
0
)
{
pr_perror
(
"Can't create TCP socket :(
\n
"
);
return
-
1
;
}
ret
=
tcp_repair_on
(
sk
);
close
(
sk
);
return
ret
;
}
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