* [PATCH net-next] tcp: allow to enable the repair mode for non-listening sockets
@ 2016-11-15 2:15 Andrei Vagin
2016-11-15 12:08 ` [CRIU] " Pavel Emelyanov
2016-11-16 3:29 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Andrei Vagin @ 2016-11-15 2:15 UTC (permalink / raw)
To: David S. Miller
Cc: linux-kernel, netdev, Alexey Kuznetsov, James Morris,
Hideaki YOSHIFUJI, Patrick McHardy, criu, Andrei Vagin
The repair mode is used to get and restore sequence numbers and
data from queues. It used to checkpoint/restore connections.
Currently the repair mode can be enabled for sockets in the established
and closed states, but for other states we have to dump the same socket
properties, so lets allow to enable repair mode for these sockets.
The repair mode reveals nothing more for sockets in other states.
Signed-off-by: Andrei Vagin <avagin@openvz.org>
---
net/ipv4/tcp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 3251fe7..a2a3a8c 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2302,7 +2302,7 @@ EXPORT_SYMBOL(tcp_disconnect);
static inline bool tcp_can_repair_sock(const struct sock *sk)
{
return ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) &&
- ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_ESTABLISHED));
+ (sk->sk_state != TCP_LISTEN);
}
static int tcp_repair_set_window(struct tcp_sock *tp, char __user *optbuf, int len)
--
2.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [CRIU] [PATCH net-next] tcp: allow to enable the repair mode for non-listening sockets
2016-11-15 2:15 [PATCH net-next] tcp: allow to enable the repair mode for non-listening sockets Andrei Vagin
@ 2016-11-15 12:08 ` Pavel Emelyanov
2016-11-16 3:29 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Pavel Emelyanov @ 2016-11-15 12:08 UTC (permalink / raw)
To: Andrei Vagin, David S. Miller
Cc: Hideaki YOSHIFUJI, netdev, James Morris, linux-kernel, criu,
Alexey Kuznetsov, Patrick McHardy
On 11/15/2016 05:15 AM, Andrei Vagin wrote:
> The repair mode is used to get and restore sequence numbers and
> data from queues. It used to checkpoint/restore connections.
>
> Currently the repair mode can be enabled for sockets in the established
> and closed states, but for other states we have to dump the same socket
> properties, so lets allow to enable repair mode for these sockets.
>
> The repair mode reveals nothing more for sockets in other states.
>
> Signed-off-by: Andrei Vagin <avagin@openvz.org>
Acked-by: Pavel Emelyanov <xemul@openvz.org>
> ---
> net/ipv4/tcp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
> index 3251fe7..a2a3a8c 100644
> --- a/net/ipv4/tcp.c
> +++ b/net/ipv4/tcp.c
> @@ -2302,7 +2302,7 @@ EXPORT_SYMBOL(tcp_disconnect);
> static inline bool tcp_can_repair_sock(const struct sock *sk)
> {
> return ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) &&
> - ((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_ESTABLISHED));
> + (sk->sk_state != TCP_LISTEN);
> }
>
> static int tcp_repair_set_window(struct tcp_sock *tp, char __user *optbuf, int len)
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] tcp: allow to enable the repair mode for non-listening sockets
2016-11-15 2:15 [PATCH net-next] tcp: allow to enable the repair mode for non-listening sockets Andrei Vagin
2016-11-15 12:08 ` [CRIU] " Pavel Emelyanov
@ 2016-11-16 3:29 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2016-11-16 3:29 UTC (permalink / raw)
To: avagin; +Cc: linux-kernel, netdev, kuznet, jmorris, yoshfuji, kaber, criu
From: Andrei Vagin <avagin@openvz.org>
Date: Mon, 14 Nov 2016 18:15:14 -0800
> The repair mode is used to get and restore sequence numbers and
> data from queues. It used to checkpoint/restore connections.
>
> Currently the repair mode can be enabled for sockets in the established
> and closed states, but for other states we have to dump the same socket
> properties, so lets allow to enable repair mode for these sockets.
>
> The repair mode reveals nothing more for sockets in other states.
>
> Signed-off-by: Andrei Vagin <avagin@openvz.org>
Applied.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-11-16 3:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-15 2:15 [PATCH net-next] tcp: allow to enable the repair mode for non-listening sockets Andrei Vagin
2016-11-15 12:08 ` [CRIU] " Pavel Emelyanov
2016-11-16 3:29 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.