Skip to content

Commit 319b053

Browse files
avagindavem330
authored andcommitted
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 <[email protected]> Acked-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ceb980b commit 319b053

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2300,7 +2300,7 @@ EXPORT_SYMBOL(tcp_disconnect);
23002300
static inline bool tcp_can_repair_sock(const struct sock *sk)
23012301
{
23022302
return ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN) &&
2303-
((1 << sk->sk_state) & (TCPF_CLOSE | TCPF_ESTABLISHED));
2303+
(sk->sk_state != TCP_LISTEN);
23042304
}
23052305

23062306
static int tcp_repair_set_window(struct tcp_sock *tp, char __user *optbuf, int len)

0 commit comments

Comments
 (0)