[CRIU] Re: [PATCH cr 1/2] sk-inet: if a source port isn't zero, a socket should be bound

Cyrill Gorcunov gorcunov at openvz.org
Mon Aug 13 08:15:18 EDT 2012


On Mon, Aug 13, 2012 at 03:50:56PM +0400, Andrey Vagin wrote:
>  static bool is_bound(struct inet_sk_info *ii)
>  {
> -	return memcmp(zero_addr, ii->ie->src_addr, pb_repeated_size(ii->ie, src_addr)) ||
> -	       memcmp(zero_addr, ii->ie->dst_addr, pb_repeated_size(ii->ie, dst_addr)) || (ii->ie->state == TCP_LISTEN);
> +	return ii->ie->src_port;
>  }

Thanks! Though I would add a comment saying that zero port is reserved that's
why we are allowed to do such trick.

	Cyrill


More information about the CRIU mailing list