2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-28 04:48:16 +00:00

11 Commits

Author SHA1 Message Date
Andrey Vagin
458cb41f57 restore: disable repair mode in post_open()
A disabling repair mode drops SO_REUSEADDR.

We can set SO_REUSEADDR after disabling repair mode, but
a small race window exists in this case.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-27 23:16:50 +04:00
Andrey Vagin
a74605a78d sk-inet: restore option REUSEADDR (v2)
All sockets are created with SO_REUSEADDR, it's needed for restoring.
E.g.: A listen socket is created after a connected socket. Both of them
are binded to one port.

So SO_REUSEADDR should be restored, when all sockets on a port were created.

This code creates a structure for each port of one type of sockets
and accounts a number of sockets, which are not restored yet.

Sockets have a hook post_open(), in which it waits when all sockets for
a defined port would be created and then it will restore SO_REUSEADDR.

struct port contains a type (udp, tcp, etc) and a port number.
It doesn't contain family or addr, because it's extra loads of logic,
which doesn't bring a significant profits.

v2: fix according with comments from Pavel

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-08-20 17:50:08 +04:00
Cyrill Gorcunov
8d92c2c3b2 protobuf: Convert inet sockets to PB engine
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-19 09:33:33 +04:00
Cyrill Gorcunov
65570d9559 sockets, inet: Use inet_sk_entry as a reference in inet_sk_info
For PB transition.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-07-16 07:03:59 +04:00
Pavel Emelyanov
4ec76b285f tcp: Add code for "check"-ing TCP repair support
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-05-03 15:21:37 +04:00
Pavel Emelyanov
f9a8673d52 tcp: Dump and restore support
What it does is uses the tcp repair engine from the kernel.

On dump the connection is locked with netfilter, socket is put
in the repair state and then its internals are dumped.

On restore we create a socket, put it into repair, dress it up
and then unlock all the connections at the very end.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-28 17:59:21 +04:00
Pavel Emelyanov
675b4698ce tcp: Put connection locking management over the code
When dump finished with error we should unlock all locked
previously connections.

When restoring we should collect connctions and unlock them
all at the end.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-28 17:59:21 +04:00
Pavel Emelyanov
a53aa45be0 tcp: Initial image description
Introduce the image file for tcp info, its entry and the show method.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-28 17:59:21 +04:00
Pavel Emelyanov
051b0a1f02 tcp: Prepare sk-inet for dumping and restoring tcp connections
First of all -- to make crtools dump/restore established tcp sockets
you have to specify the --tcp-established options. By doing so you
inform crtools that

a) you know, that after dump there will be a netfilter rules blocking
   the dumped connections

b) you guarantee, that before restore this netfilter block is still
   there

What else this patch does is simple -- collects establised sockets and
calls the dump/restore tcp function (now empty) where appropriate.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-28 17:59:21 +04:00
Pavel Emelyanov
a915a4622d inet: Move inet sk cpt and rst structs to header
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-28 17:59:20 +04:00
Pavel Emelyanov
65e48c41b1 inet: Introduce helpers for binding and connecting inet socket on restore
Just a codemove.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2012-04-28 17:59:20 +04:00