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

Pavel Emelyanov xemul at parallels.com
Tue Oct 30 11:23:20 EDT 2012


On 10/30/2012 07:19 PM, Cyrill Gorcunov wrote:
> 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?

For TCP -- yes, but have UDP as well.


More information about the CRIU mailing list