Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 319b0534 authored by Andrey Vagin's avatar Andrey Vagin Committed by David S. Miller
Browse files

tcp: allow to enable the repair mode for non-listening sockets



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: default avatarAndrei Vagin <avagin@openvz.org>
Acked-by: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ceb980bc
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2300,7 +2300,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)