On 12/10/2015 10:17, Jason Wang wrote:
>  static ssize_t nc_sendv_compat(NetClientState *nc, const struct iovec *iov,
> -                               int iovcnt)
> +                               int iovcnt, unsigned flags)
>  {
> -    uint8_t buffer[NET_BUFSIZE];
> +    uint8_t buf[NET_BUFSIZE];
> +    uint8_t *buffer;
>      size_t offset;
>  
> -    offset = iov_to_buf(iov, iovcnt, 0, buffer, sizeof(buffer));
> +    if (iovcnt == 1) {
> +        buffer = iov[0].iov_base;
> +        offset = iov[0].iov_len;
> +    } else {
> +        buffer = buf;
> +        offset = iov_to_buf(iov, iovcnt, 0, buffer, sizeof(buffer));

You want "buf, sizeof(buf)" here.  sizeof(buffer) is the size of a
pointer, which is wrong.

Jason, can you please fix this?

Paolo

> +    }

Reply via email to