[CRIU] [PATCH] sk-netlink: typo fix for unconnected netlink sockets

Andrew Vagin avagin at parallels.com
Fri Mar 29 12:09:39 EDT 2013


On Fri, Mar 29, 2013 at 08:05:32PM +0400, Pavel Emelyanov wrote:
> On 03/29/2013 07:52 PM, Andrey Vagin wrote:
> > The netlink_diag doesn't provide any info about non-connected and
> > non-bound sockets.
> 
> What if we for any reason found an fd, that points to netlink socket,
> that was not collected? Will lookup_socket() return ERR or NULL?

It will return NULL. ERR is returned when netlink_diag are not loaded.

I broke this one day ago:
commit d2b1d6f2aa62d4fdd7340f9ba86764f67917f82b
Author: Andrey Vagin <avagin at openvz.org>
Date:   Wed Mar 27 23:51:03 2013 +0400

    socket: prevent dumping of sockets if they are not collected


> 
> > Signed-off-by: Andrey Vagin <avagin at openvz.org>
> > ---
> >  sk-netlink.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/sk-netlink.c b/sk-netlink.c
> > index b06808b..dbfe8ca 100644
> > --- a/sk-netlink.c
> > +++ b/sk-netlink.c
> > @@ -91,7 +91,7 @@ static int dump_one_netlink_fd(int lfd, u32 id, const struct fd_parms *p)
> >  	SkOptsEntry skopts = SK_OPTS_ENTRY__INIT;
> >  
> >  	sk = (struct netlink_sk_desc *)lookup_socket(p->stat.st_ino, PF_NETLINK, 0);
> > -	if (IS_ERR_OR_NULL(sk))
> > +	if (IS_ERR(sk))
> >  		goto err;
> >  
> >  	ne.id = id;
> > 
> 
> 


More information about the CRIU mailing list