[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] net: make iov_to_buf take right size argume
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] net: make iov_to_buf take right size argument in nc_sendv_compat() |
Date: |
Tue, 20 Oct 2015 10:06:56 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 20/10/2015 09:20, Jason Wang wrote:
>
>
> On 10/20/2015 09:51 AM, Yang Hongyang wrote:
>> We want "buf, sizeof(buf)" here. sizeof(buffer) is the size of a
>> pointer, which is wrong.
>> Thanks to Paolo for pointing it out.
>>
>> Signed-off-by: Yang Hongyang <address@hidden>
>> Cc: Jason Wang <address@hidden>
>> Cc: Paolo Bonzini <address@hidden>
>> ---
>> net/net.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/net/net.c b/net/net.c
>> index 39af893..0c4a012 100644
>> --- a/net/net.c
>> +++ b/net/net.c
>> @@ -700,7 +700,7 @@ static ssize_t nc_sendv_compat(NetClientState *nc, const
>> struct iovec *iov,
>> offset = iov[0].iov_len;
>> } else {
>> buffer = buf;
>> - offset = iov_to_buf(iov, iovcnt, 0, buffer, sizeof(buffer));
>> + offset = iov_to_buf(iov, iovcnt, 0, buf, sizeof(buf));
>> }
>>
>> if (flags & QEMU_NET_PACKET_FLAG_RAW && nc->info->receive_raw) {
>
> Both two patches were applied in:
>
> https://github.com/jasowang/qemu/commits/net
>
> Thanks
Thanks!
Paolo