[CRIU] [PATCH 1/3] tcp: allow to enable repair mode for sockets in any state

Andrey Vagin avagin at openvz.org
Tue Mar 4 21:18:10 PST 2014


The repair mode is used for dumping state of tcp connections
(sequence numbers, queues, options, etc).

Currently the repair mode can be enalbed only for sockets in the
TCP_ESTABLISHED state. If a socket in another state, its internal
state can not be dumped.

I see nothing wrong to allow enabling of the repair mode for any state.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 net/ipv4/tcp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 9f3a2db..819fa37 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -2372,8 +2372,7 @@ void tcp_sock_destruct(struct sock *sk)
 
 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));
+	return ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN);
 }
 
 static int tcp_repair_options_est(struct tcp_sock *tp,
-- 
1.8.5.3



More information about the CRIU mailing list