[CRIU] Re: [PATCH] sk: optimize dump size a bit
Pavel Emelyanov
xemul at parallels.com
Mon Aug 6 10:41:32 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(-)
> @@ -209,8 +213,8 @@ static int dump_one_inet_fd(int lfd, u32 id, const struct fd_parms *p)
> if (!ie.src_addr || !ie.dst_addr)
> goto err;
>
> - memcpy(ie.src_addr, sk->src_addr, sizeof(u32) * 4);
> - memcpy(ie.dst_addr, sk->dst_addr, sizeof(u32) * 4);
> + memcpy(ie.src_addr, sk->src_addr, sizeof(u32) * ie.n_src_addr);
> + memcpy(ie.dst_addr, sk->dst_addr, sizeof(u32) * ie.n_dst_addr);
pb_repeated_size(), not sizeof(u32) * ie.n_xxx_addr;
>
> if (dump_socket_opts(lfd, &skopts))
> goto err;
More information about the CRIU
mailing list