[CRIU] Re: [PATCH 2/2] sk-inet: Use sockaddr_in structure instead of 128 byte address

Cyrill Gorcunov gorcunov at openvz.org
Tue Oct 30 11:19:26 EDT 2012


On Tue, Oct 30, 2012 at 07:02:23PM +0400, Pavel Emelyanov wrote:
> >  
> >  	/* It should has no peer name */
> > -	aux = sizeof(address);
> > -	ret = getsockopt(lfd, SOL_SOCKET, SO_PEERNAME, address, &aux);
> > +	aux = sizeof(sin);
> 
> for ipv6 it should be sizeof(another struct). but to check for conn/unconn it's enough to
> pass there 1-byte len.

I believe better to pass sockaddr_in/sockaddr6_in here depending on family and
if the call success (I presume on close-wait we can have it) then the code

		if (info.tcpi_state != TCP_CLOSE) {
			pr_err("Socket state %d obtained but expected %d\n",
			       info.tcpi_state, TCP_CLOSE);
			goto err;
		}

will catch the problem, no?


More information about the CRIU mailing list