aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Hongyang <yanghy@cn.fujitsu.com>2015-10-20 09:51:25 +0800
committerJason Wang <jasowang@redhat.com>2015-10-27 10:30:40 +0800
commitedc981443d5bd23e01639c2fbba4fbc2dc30204f (patch)
tree962fb402b6c57523d2d494079a0c3a60cd1cc5c2
parent5320c2caf43cc76748a1ffa0fdcaa9eb501d3fcd (diff)
net: make iov_to_buf take right size argument in nc_sendv_compat()
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 <yanghy@cn.fujitsu.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
-rw-r--r--net/net.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/net.c b/net/net.c
index 70a3576db9..2f2b39e09b 100644
--- a/net/net.c
+++ b/net/net.c
@@ -708,7 +708,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) {