Commit 2045ef18 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

tcp: disable the repair mode only for sockets of a current process (v3)

rst_tcp_repair_sockets is filled when all sockets are collected,
but the repair mode should be disabled only for sockets which
are restored in a current process.

https://bugzilla.openvz.org/show_bug.cgi?id=3281

v2: add a comment
v3: typo fix

Fixes: 73e303c8 ('rst: Fix rst_tcp_sock memory management')
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 9c96c55b
...@@ -665,6 +665,13 @@ int rst_tcp_socks_prep(void) ...@@ -665,6 +665,13 @@ int rst_tcp_socks_prep(void)
list_for_each_entry(ii, &rst_tcp_repair_sockets, rlist) { list_for_each_entry(ii, &rst_tcp_repair_sockets, rlist) {
struct rst_tcp_sock *rs; struct rst_tcp_sock *rs;
/*
* rst_tcp_repair_sockets contains all sockets, so we need to
* select sockets which restored in a current porcess.
*/
if (ii->sk_fd == -1)
continue;
rs = rst_mem_alloc(sizeof(*rs), RM_PRIVATE); rs = rst_mem_alloc(sizeof(*rs), RM_PRIVATE);
if (!rs) if (!rs)
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment