summaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp.c
diff options
context:
space:
mode:
authorAndrey Vagin <avagin@openvz.org>2016-11-14 18:15:14 -0800
committerDavid S. Miller <davem@davemloft.net>2016-11-15 22:28:50 -0500
commit319b0534b9588124cdc7128e121f3f85daaab556 (patch)
tree5aeec604404c4ed6130312e662cb1c21d8aab922 /net/ipv4/tcp.c
parentceb980bc2c29dc0fafe6f108395626c6c46d5d55 (diff)
downloadlinux-319b0534b9588124cdc7128e121f3f85daaab556.tar.gz
linux-319b0534b9588124cdc7128e121f3f85daaab556.tar.xz
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: Andrei Vagin <avagin@openvz.org> Acked-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp.c')
-rw-r--r--net/ipv4/tcp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index b025a69ebd28..913f9bbfc030 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -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)