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
fe3fb885
Commit
fe3fb885
authored
Sep 25, 2013
by
Pavel Emelyanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tcp: Support CORK and NODELAY options
Signed-off-by:
Pavel Emelyanov
<
xemul@parallels.com
>
parent
4b6e1d6d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
2 deletions
+37
-2
tcp-stream.proto
protobuf/tcp-stream.proto
+3
-0
sk-tcp.c
sk-tcp.c
+34
-2
No files found.
protobuf/tcp-stream.proto
View file @
fe3fb885
...
@@ -9,4 +9,7 @@ message tcp_stream_entry {
...
@@ -9,4 +9,7 @@ message tcp_stream_entry {
required
uint32
mss_clamp
=
7
;
required
uint32
mss_clamp
=
7
;
optional
uint32
rcv_wscale
=
8
;
optional
uint32
rcv_wscale
=
8
;
optional
uint32
timestamp
=
9
;
optional
uint32
timestamp
=
9
;
optional
bool
cork
=
10
;
optional
bool
nodelay
=
11
;
}
}
sk-tcp.c
View file @
fe3fb885
...
@@ -301,7 +301,7 @@ err_sopt:
...
@@ -301,7 +301,7 @@ err_sopt:
static
int
dump_tcp_conn_state
(
struct
inet_sk_desc
*
sk
)
static
int
dump_tcp_conn_state
(
struct
inet_sk_desc
*
sk
)
{
{
int
ret
,
img_fd
;
int
ret
,
img_fd
,
aux
;
TcpStreamEntry
tse
=
TCP_STREAM_ENTRY__INIT
;
TcpStreamEntry
tse
=
TCP_STREAM_ENTRY__INIT
;
char
*
in_buf
,
*
out_buf
;
char
*
in_buf
,
*
out_buf
;
...
@@ -336,6 +336,26 @@ static int dump_tcp_conn_state(struct inet_sk_desc *sk)
...
@@ -336,6 +336,26 @@ static int dump_tcp_conn_state(struct inet_sk_desc *sk)
if
(
ret
<
0
)
if
(
ret
<
0
)
goto
err_opt
;
goto
err_opt
;
/*
* TCP socket options
*/
if
(
dump_opt
(
sk
->
rfd
,
SOL_TCP
,
TCP_NODELAY
,
&
aux
))
goto
err_opt
;
if
(
aux
)
{
tse
.
has_nodelay
=
true
;
tse
.
nodelay
=
true
;
}
if
(
dump_opt
(
sk
->
rfd
,
SOL_TCP
,
TCP_CORK
,
&
aux
))
goto
err_opt
;
if
(
aux
)
{
tse
.
has_cork
=
true
;
tse
.
cork
=
true
;
}
/*
/*
* Push the stuff to image
* Push the stuff to image
*/
*/
...
@@ -522,7 +542,7 @@ static int restore_tcp_opts(int sk, TcpStreamEntry *tse)
...
@@ -522,7 +542,7 @@ static int restore_tcp_opts(int sk, TcpStreamEntry *tse)
static
int
restore_tcp_conn_state
(
int
sk
,
struct
inet_sk_info
*
ii
)
static
int
restore_tcp_conn_state
(
int
sk
,
struct
inet_sk_info
*
ii
)
{
{
int
ifd
;
int
ifd
,
aux
;
TcpStreamEntry
*
tse
;
TcpStreamEntry
*
tse
;
pr_info
(
"Restoring TCP connection id %x ino %x
\n
"
,
ii
->
ie
->
id
,
ii
->
ie
->
ino
);
pr_info
(
"Restoring TCP connection id %x ino %x
\n
"
,
ii
->
ie
->
id
,
ii
->
ie
->
ino
);
...
@@ -549,6 +569,18 @@ static int restore_tcp_conn_state(int sk, struct inet_sk_info *ii)
...
@@ -549,6 +569,18 @@ static int restore_tcp_conn_state(int sk, struct inet_sk_info *ii)
if
(
restore_tcp_queues
(
sk
,
tse
,
ifd
))
if
(
restore_tcp_queues
(
sk
,
tse
,
ifd
))
goto
err_c
;
goto
err_c
;
if
(
tse
->
has_nodelay
&&
tse
->
nodelay
)
{
aux
=
1
;
if
(
restore_opt
(
sk
,
SOL_TCP
,
TCP_NODELAY
,
&
aux
))
goto
err_c
;
}
if
(
tse
->
has_cork
&&
tse
->
cork
)
{
aux
=
1
;
if
(
restore_opt
(
sk
,
SOL_TCP
,
TCP_CORK
,
&
aux
))
goto
err_c
;
}
tcp_stream_entry__free_unpacked
(
tse
,
NULL
);
tcp_stream_entry__free_unpacked
(
tse
,
NULL
);
close
(
ifd
);
close
(
ifd
);
return
0
;
return
0
;
...
...
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