[13/18] unix: Set queuer in set_peer

Submitted by Pavel Emelyanov on July 10, 2017, 9:40 a.m.

Details

Message ID 22a933e4-d4ae-d31c-540e-ec6dd099218c@virtuozzo.com
State Accepted
Series "Support descriptors sent over unix sockets"
Headers show

Commit Message

Pavel Emelyanov July 10, 2017, 9:40 a.m.
For SCM restore we need to know all queuers, even if they are
socketpair-s, but current code skips this setting for one
half of them. So set this info for every socket out there.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/sk-unix.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index 765d9ae..901c74b 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -1488,6 +1488,8 @@  static void set_peer(struct unix_sk_info *ui, struct unix_sk_info *peer)
 {
 	ui->peer = peer;
 	list_add(&ui->node, &peer->connected);
+	if (!peer->queuer)
+		peer->queuer = ui->ue->ino;
 }
 
 static void interconnected_pair(struct unix_sk_info *ui, struct unix_sk_info *peer)
@@ -1527,8 +1529,6 @@  static int resolve_unix_peer(struct unix_sk_info *ui)
 	}
 
 	set_peer(ui, peer);
-	if (!peer->queuer)
-		peer->queuer = ui->ue->ino;
 	if (ui == peer)
 		/* socket connected to self %) */
 		goto out;