[CRIU] Re: [PATCH 4/4] sockets: Restore unconnected dgram sockets v4

Cyrill Gorcunov gorcunov at openvz.org
Tue Apr 17 11:22:37 EDT 2012


On Tue, Apr 17, 2012 at 07:16:14PM +0400, Pavel Emelyanov wrote:
> On 04/17/2012 06:32 PM, Cyrill Gorcunov wrote:
> > On Tue, Apr 17, 2012 at 06:15:26PM +0400, Pavel Emelyanov wrote:
> >>
> >>> @@ -1370,6 +1435,16 @@ static int open_unixsk_standalone(struct unix_sk_info *ui)
> >>>  	if (restore_fown(sk, &ui->ue.fown))
> >>>  		return -1;
> >>>  
> >>> +	/*
> >>> +	 * No connect should be done over external peers,
> >>> +	 * simply bind only to them, and that's all.
> >>> +	 */
> >>> +	if (ui->peer && ui->peer->ue.uflags & USK_EXTERN) {
> >>> +		if (bind_unix_sk(sk, ui->peer))
> >>> +			return -1;
> >>> +		return sk;
> >>> +	}
> >>> +
> >>>  	if (bind_unix_sk(sk, ui))
> >>>  		return -1;
> >>>  
> >>
> >> I don't understand why this hunk is needed. This only occurs when we meet someone's file
> >> descriptor pointing to this socket. External sockets don't have anybody with a descriptor
> >> pointing on them (otherwise they would be "internal")
> >>
> > 
> > OK, letme explain, the crond uses /dev/log to send messages, lets say our socket
> > is sk1 (id = 1), while /dev/log socket is sk2 (id = 2) (and it's external one not bound to
> > us).
> > 
> > So in dump we have
> > 
> > sk1: id 1 peer 2 name nil (it correspond some fd inside crond)
> > sk2: id 2 peer 0 name /dev/log
> > 
> > once dump complete, on image it looks like
> > 
> >  sk1: id 1 peer  2 name nil
> >  sk2: id 2 peer -1 name /dev/log
> > 
> > so sk1 must be created and bount to peer's name /dev/log,
> 
> Not bound, but connected. Himself he can be bound to nothing.

Oh, yup, indeed. I'll fix up.

	Cyrill


More information about the CRIU mailing list