[CRIU] Re: [PATCH] sk: optimize dump size a bit

Pavel Emelyanov xemul at parallels.com
Mon Aug 6 10:42:35 EDT 2012


On 08/02/2012 02:39 PM, Kinsbursky Stanislav wrote:
> From: Stanislav Kinsbursky <skinsbursky at openvz.org>
> 
> Let's carry only on uint_32 for IPv4 address.
> 
> Signed-off-by: Stanislav Kinsbursky <skinsbursky at openvz.org>
> ---
>  sk-inet.c |   16 ++++++++--------
>  1 files changed, 8 insertions(+), 8 deletions(-)

> @@ -279,10 +283,6 @@ static u32 zero_addr[4];
>  
>  static bool is_bound(struct inet_sk_info *ii)
>  {
> -	BUG_ON(sizeof(zero_addr) <
> -		     max(pb_repeated_size(ii->ie, dst_addr),
> -			 pb_repeated_size(ii->ie, src_addr)));
> -
>  	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));
>  }

Not just remove the bugons, but check for pb_repeated_size correspond to sizeof-s
of sockaddrs here and in other places.


More information about the CRIU mailing list