[CRIU] [PATCH] unix: restore file params and sockopts for all standalone sockets

Andrey Vagin avagin at openvz.org
Fri Nov 2 03:38:14 EDT 2012


We can have a situation, when a socket is bound, but isn't listen yet.

I can't find a situation, when we should not restore parameters.

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 sk-unix.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sk-unix.c b/sk-unix.c
index ced58e1..1b1840f 100644
--- a/sk-unix.c
+++ b/sk-unix.c
@@ -686,14 +686,13 @@ static int open_unixsk_standalone(struct unix_sk_info *ui)
 			pr_perror("Can't make usk listen");
 			return -1;
 		}
+	}
 
-		if (rst_file_params(sk, ui->ue->fown, ui->ue->flags))
-			return -1;
-
-		if (restore_socket_opts(sk, ui->ue->opts))
-			return -1;
+	if (rst_file_params(sk, ui->ue->fown, ui->ue->flags))
+		return -1;
 
-	}
+	if (restore_socket_opts(sk, ui->ue->opts))
+		return -1;
 
 	return sk;
 }
-- 
1.7.11.7



More information about the CRIU mailing list